/* ============================================================
   Kind Care Solutions Enquiry Form — form.css
   Brand: Forest #245246 | Sage #7BA693 | Sand #F5EFE6
   Fonts: Montserrat + Inter (loaded from Google Fonts separately
          if needed — form uses system fallbacks if not present)
   ============================================================ */

/* ---- Root variables ---- */
.rfsf-wrap {
    --rf-navy:  #245246;
    --rf-blue:  #7BA693;
    --rf-aqua:  #ADC9B7;
    --rf-steel: #5F6F69;
    --rf-mist:  #F5EFE6;
    --rf-error: #e53e3e;
    --rf-ok:    #38a169;
    --rf-radius: 10px;
    --rf-font-h: 'Montserrat', system-ui, sans-serif;
    --rf-font-b: 'Inter', system-ui, sans-serif;

    background: #ffffff;
    border: 1.5px solid rgba(36, 82, 70, 0.1);
    border-radius: 16px;
    padding: 36px;
    max-width: 720px;
    box-shadow: 0 10px 36px rgba(36, 82, 70, 0.08);
    font-family: var(--rf-font-b);
    box-sizing: border-box;
}

/* ---- Header ---- */
.rfsf-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 22px;
}

.rfsf-header-icon {
    width: 52px;
    height: 52px;
    background: rgba(123, 166, 147, 0.16);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--rf-blue);
    flex-shrink: 0;
}

.rfsf-title {
    font-family: var(--rf-font-h);
    font-size: 20px;
    font-weight: 800;
    color: var(--rf-navy);
    margin: 0 0 5px !important;
    padding: 0 !important;
    line-height: 1.2;
}

.rfsf-subtitle {
    font-size: 14px;
    color: var(--rf-steel);
    margin: 0 !important;
    line-height: 1.5;
}

/* ---- Contact bar ---- */
.rfsf-contact-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    background: linear-gradient(135deg, rgba(245, 239, 230, 0.95), rgba(173, 201, 183, 0.28));
    border: 1px solid rgba(123, 166, 147, 0.28);
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 600;
    color: var(--rf-navy);
    margin-bottom: 28px;
}

.rfsf-contact-tag {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(36, 82, 70, 0.08);
    color: var(--rf-navy);
}

.rfsf-contact-bar a {
    color: var(--rf-blue);
    text-decoration: none;
    font-weight: 700;
}

.rfsf-contact-bar a:hover {
    text-decoration: underline;
}

/* ---- Response message ---- */
.rfsf-response {
    display: none;
    padding: 16px 20px;
    border-radius: var(--rf-radius);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.55;
    margin-bottom: 24px;
}

.rfsf-response.rfsf-success {
    display: block;
    background: rgba(56, 161, 105, 0.1);
    border: 1px solid rgba(56, 161, 105, 0.35);
    color: #276749;
}

.rfsf-response.rfsf-fail {
    display: block;
    background: rgba(229, 62, 62, 0.08);
    border: 1px solid rgba(229, 62, 62, 0.3);
    color: #c53030;
}

/* ---- Form layout ---- */
.rfsf-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.rfsf-row {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.rfsf-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* ---- Field ---- */
.rfsf-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.rfsf-field label {
    font-family: var(--rf-font-h);
    font-size: 13px;
    font-weight: 700;
    color: var(--rf-navy);
    margin: 0;
}

.rfsf-req {
    color: var(--rf-blue);
}

.rfsf-optional {
    color: var(--rf-steel);
    font-weight: 400;
}

/* ---- Inputs & textarea ---- */
.rfsf-field input[type="text"],
.rfsf-field input[type="tel"],
.rfsf-field input[type="email"],
.rfsf-field textarea {
    width: 100%;
    padding: 12px 14px;
    font-family: var(--rf-font-b);
    font-size: 14px;
    color: #1a202c;
    background: #ffffff;
    border: 1.5px solid #d1dae4;
    border-radius: var(--rf-radius);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
    -webkit-appearance: none;
}

.rfsf-field input:focus,
.rfsf-field textarea:focus {
    border-color: var(--rf-blue);
    box-shadow: 0 0 0 3px rgba(123, 166, 147, 0.18);
}

.rfsf-field input.rfsf-invalid,
.rfsf-field textarea.rfsf-invalid {
    border-color: var(--rf-error);
    box-shadow: 0 0 0 3px rgba(229, 62, 62, 0.1);
}

.rfsf-field input::placeholder,
.rfsf-field textarea::placeholder {
    color: #a0aec0;
}

.rfsf-field textarea {
    resize: vertical;
    min-height: 110px;
}

/* ---- Select ---- */
.rfsf-wrap .rfsf-select-wrap {
    position: relative;
    display: block;
}

.rfsf-wrap .rfsf-select-wrap select,
.rfsf-wrap select.rfsf-select {
    display: block !important;
    width: 100% !important;
    padding: 12px 40px 12px 14px !important;
    font-family: var(--rf-font-b) !important;
    font-size: 14px !important;
    color: #1a202c !important;
    background: #ffffff !important;
    background-image: none !important;
    border: 1.5px solid #d1dae4 !important;
    border-radius: var(--rf-radius) !important;
    outline: none !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    cursor: pointer !important;
    transition: border-color 0.2s, box-shadow 0.2s !important;
    box-sizing: border-box !important;
    box-shadow: none !important;
    height: auto !important;
    line-height: normal !important;
    margin: 0 !important;
}

.rfsf-wrap .rfsf-select-wrap select:focus {
    border-color: var(--rf-blue) !important;
    box-shadow: 0 0 0 3px rgba(123, 166, 147, 0.18) !important;
}

.rfsf-wrap .rfsf-select-wrap select.rfsf-invalid {
    border-color: var(--rf-error) !important;
}

.rfsf-select-arrow {
    position: absolute;
    right: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--rf-steel);
    pointer-events: none;
    z-index: 1;
}

/* ---- Inline error messages ---- */
.rfsf-error {
    font-size: 12px;
    color: var(--rf-error);
    font-weight: 500;
    display: none;
    margin-top: 2px;
}

.rfsf-error.rfsf-visible {
    display: block;
}

/* ---- Submit row ---- */
.rfsf-submit-row {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 6px;
}

.rfsf-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    background: #549338;
    color: #ffffff;
    font-family: var(--rf-font-h);
    font-weight: 800;
    font-size: 15px;
    padding: 14px 32px;
    border: none;
    border-radius: var(--rf-radius);
    cursor: pointer;
    transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
    box-shadow: 0 8px 24px rgba(84, 147, 56, 0.28);
    white-space: nowrap;
}

.rfsf-submit:hover:not(:disabled) {
    background: #447a2d;
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(84, 147, 56, 0.34);
}

.rfsf-submit:active {
    transform: translateY(0);
}

.rfsf-submit:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
}

/* Spinner animation */
.rfsf-spinner {
    animation: rfsf-spin 0.8s linear infinite;
}

@keyframes rfsf-spin {
    to { transform: rotate(360deg); }
}

/* ---- Privacy note ---- */
.rfsf-privacy-note {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: var(--rf-steel);
    margin: 0;
}

/* ---- Thank you panel (replaces form on success) ---- */
.rfsf-thankyou {
    text-align: center;
    padding: 48px 24px;
}

.rfsf-thankyou-icon {
    width: 72px; height: 72px;
    background: rgba(56, 161, 105, 0.12);
    border: 2px solid rgba(56, 161, 105, 0.35);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #38a169;
    margin: 0 auto 24px;
}

.rfsf-thankyou-title {
    font-family: var(--rf-font-h);
    font-size: 22px;
    font-weight: 900;
    color: var(--rf-navy);
    margin: 0 0 12px;
}

.rfsf-thankyou-msg {
    font-family: var(--rf-font-b);
    font-size: 15px;
    color: var(--rf-steel);
    line-height: 1.6;
    margin: 0 0 28px;
    max-width: 360px;
    margin-left: auto;
    margin-right: auto;
}

.rfsf-thankyou-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--rf-blue);
    color: #fff;
    font-family: var(--rf-font-h);
    font-weight: 700;
    font-size: 15px;
    padding: 13px 28px;
    border-radius: var(--rf-radius);
    text-decoration: none;
    transition: background 0.2s, transform 0.15s;
    box-shadow: 0 6px 20px rgba(123, 166, 147, 0.3);
}

.rfsf-thankyou-btn:hover {
    background: #648b7a;
    transform: translateY(-2px);
}

/* ---- Job popup ---- */
.rfsf-job-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    border: none;
    border-radius: 999px;
    background: #549338;
    color: #fff;
    font-family: var(--rf-font-h);
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 10px 28px rgba(84, 147, 56, 0.24);
    transition: transform 0.2s, box-shadow 0.2s;
}

.rfsf-job-trigger:hover {
    background: #447a2d;
    transform: translateY(-2px);
    box-shadow: 0 14px 32px rgba(84, 147, 56, 0.3);
}

.rfsf-job-modal {
    position: fixed;
    inset: 0;
    display: none;
    z-index: 9999;
}

.rfsf-job-modal.is-open {
    display: block;
}

.rfsf-job-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(20, 31, 28, 0.58);
    backdrop-filter: blur(4px);
}

.rfsf-job-dialog {
    position: relative;
    width: min(680px, calc(100% - 32px));
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    margin: 24px auto;
    background: #fff;
    border-radius: 24px;
    padding: 32px;
    box-shadow: 0 24px 60px rgba(20, 31, 28, 0.22);
}

.rfsf-job-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: rgba(36, 82, 70, 0.08);
    color: var(--rf-navy);
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}

.rfsf-job-header {
    margin-bottom: 24px;
    padding-right: 32px;
}

.rfsf-job-progress {
    margin-bottom: 22px;
}

.rfsf-job-progress-bar {
    width: 100%;
    height: 10px;
    border-radius: 999px;
    background: #e7efe2;
    overflow: hidden;
    margin-bottom: 10px;
}

.rfsf-job-progress-fill {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #7bb433, #549338);
    transition: width 0.25s ease;
}

.rfsf-job-progress-meta {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    font-size: 13px;
    color: var(--rf-steel);
}

.rfsf-job-progress-step {
    font-weight: 700;
    color: var(--rf-navy);
}

.rfsf-job-eyebrow {
    display: inline-flex;
    margin-bottom: 10px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(123, 166, 147, 0.14);
    color: var(--rf-navy);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.rfsf-job-header h3 {
    margin: 0 0 8px;
    font-family: var(--rf-font-h);
    font-size: 28px;
    color: var(--rf-navy);
    line-height: 1.2;
}

.rfsf-job-header p {
    margin: 0;
    color: var(--rf-steel);
    line-height: 1.6;
}

.rfsf-job-response {
    display: none;
    margin-bottom: 18px;
    padding: 14px 16px;
    border-radius: var(--rf-radius);
}

.rfsf-job-response.rfsf-success,
.rfsf-job-response.rfsf-fail {
    display: block;
}

.rfsf-job-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.rfsf-job-step {
    display: none;
    animation: rfsf-step-in 0.22s ease;
}

.rfsf-job-step.is-active {
    display: block;
}

.rfsf-job-actions {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 18px;
}

.rfsf-job-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 120px;
    padding: 14px 22px;
    border: 1px solid rgba(84, 147, 56, 0.28);
    border-radius: var(--rf-radius);
    background: #edf5e8;
    color: #447a2d;
    font-family: var(--rf-font-h);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}

.rfsf-job-secondary:hover {
    background: #e2efda;
    transform: translateY(-1px);
}

@keyframes rfsf-step-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

body.rfsf-modal-open {
    overflow: hidden;
}

/* ---- Responsive ---- */
@media (max-width: 580px) {
    .rfsf-wrap {
        padding: 24px 20px;
    }
    .rfsf-row-2 {
        grid-template-columns: 1fr;
    }
    .rfsf-header {
        flex-direction: column;
        gap: 12px;
    }
    .rfsf-submit-row {
        flex-direction: column;
        align-items: flex-start;
    }
    .rfsf-submit {
        width: 100%;
    }
    .rfsf-job-dialog {
        width: calc(100% - 20px);
        margin: 10px auto;
        max-height: calc(100vh - 20px);
        padding: 24px 18px;
        border-radius: 18px;
    }
    .rfsf-job-trigger {
        width: 100%;
    }
    .rfsf-job-header h3 {
        font-size: 24px;
    }
    .rfsf-job-progress-meta,
    .rfsf-job-actions,
    .rfsf-submit-row {
        flex-direction: column;
        align-items: stretch;
    }
    .rfsf-job-secondary,
    .rfsf-submit {
        width: 100%;
    }
}
