/* ── Smart Forms Builder – Frontend ───────────────────────────────────── */
.sfb-form-wrap * { box-sizing: border-box; }

.sfb-form-wrap { max-width: 680px; }

/* Messages */
.sfb-messages { margin-bottom: 16px; }
.sfb-message-success {
    background: #edfaed;
    border: 1px solid #89d989;
    border-left: 4px solid #46b450;
    color: #1a7a1a;
    padding: 14px 18px;
    border-radius: 4px;
    font-size: 15px;
}
.sfb-message-error {
    background: #fdf0f0;
    border: 1px solid #f5c0c0;
    border-left: 4px solid #dc3232;
    color: #a00;
    padding: 14px 18px;
    border-radius: 4px;
    font-size: 14px;
}

/* Fields wrapper */
.sfb-fields { display: flex; flex-wrap: wrap; gap: 0 16px; }

/* Individual field */
.sfb-field { margin-bottom: 18px; }

/* Widths */
.sfb-field-width-100 { width: 100%; }
.sfb-field-width-75  { width: calc(75% - 8px); }
.sfb-field-width-66  { width: calc(66.6% - 8px); }
.sfb-field-width-50  { width: calc(50% - 8px); }
.sfb-field-width-33  { width: calc(33.3% - 8px); }
.sfb-field-width-25  { width: calc(25% - 8px); }

/* Labels */
.sfb-field > label,
.sfb-field fieldset > legend {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
    color: #333;
    border: none;
    padding: 0;
    float: none;
    width: auto;
}
.sfb-required { color: #dc3232; margin-left: 2px; }

/* Inputs */
.sfb-field input[type="text"],
.sfb-field input[type="email"],
.sfb-field input[type="tel"],
.sfb-field input[type="number"],
.sfb-field input[type="url"],
.sfb-field input[type="date"],
.sfb-field input[type="file"],
.sfb-field select,
.sfb-field textarea {
    display: block;
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff;
    color: #333;
    transition: border-color .2s, box-shadow .2s;
    font-family: inherit;
}
.sfb-field input:focus,
.sfb-field select:focus,
.sfb-field textarea:focus {
    border-color: #0073aa;
    outline: none;
    box-shadow: 0 0 0 3px rgba(0,115,170,.12);
}
.sfb-field input.sfb-has-error,
.sfb-field select.sfb-has-error,
.sfb-field textarea.sfb-has-error {
    border-color: #dc3232;
    box-shadow: 0 0 0 3px rgba(220,50,50,.1);
}

/* Radio / Checkbox */
.sfb-radio-label,
.sfb-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 400;
    margin-bottom: 6px;
    cursor: pointer;
}
.sfb-radio-label input,
.sfb-checkbox-label input { width: auto !important; margin: 0 !important; }

/* Divider */
.sfb-field-divider { width: 100%; margin: 8px 0; }
.sfb-field-divider hr { border: none; border-top: 1px solid #ddd; }

/* Heading */
.sfb-field-heading { width: 100%; }
.sfb-field-heading h3 { margin: 0 0 4px; font-size: 18px; }

/* Error */
.sfb-field-error {
    display: block;
    color: #dc3232;
    font-size: 12px;
    margin-top: 4px;
    min-height: 16px;
}

/* Submit */
.sfb-submit-wrap { margin-top: 8px; }
.sfb-submit {
    display: inline-block;
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 12px 28px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s;
    font-family: inherit;
}
.sfb-submit:hover  { background: #005177; }
.sfb-submit:active { background: #003d5c; }
.sfb-submit:disabled { opacity: .65; cursor: not-allowed; }

/* Spinner */
.sfb-submit.is-loading::after {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,.5);
    border-top-color: #fff;
    border-radius: 50%;
    animation: sfb-spin .6s linear infinite;
    margin-left: 8px;
    vertical-align: middle;
}
@keyframes sfb-spin { to { transform: rotate(360deg); } }

@media (max-width: 480px) {
    .sfb-field-width-75,
    .sfb-field-width-66,
    .sfb-field-width-50,
    .sfb-field-width-33,
    .sfb-field-width-25 { width: 100%; }
}
