/* ============================================================
   RapidFlow Services Form — form.css
   Brand: Navy #0E2A47 | Blue #1297F3 | Aqua #58C7FF
   Fonts: Montserrat + Inter (loaded from Google Fonts separately
          if needed — form uses system fallbacks if not present)
   ============================================================ */

/* ---- Root variables ---- */
.rfsf-wrap {
    --rf-navy:  #0E2A47;
    --rf-blue:  #1297F3;
    --rf-aqua:  #58C7FF;
    --rf-steel: #7C8A99;
    --rf-mist:  #E9F1F7;
    --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(14, 42, 71, 0.09);
    border-radius: 16px;
    padding: 36px;
    max-width: 720px;
    box-shadow: 0 8px 40px rgba(14, 42, 71, 0.07);
    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(18, 151, 243, 0.1);
    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;
}

/* ---- Emergency bar ---- */
.rfsf-emergency-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(18, 151, 243, 0.07);
    border: 1px solid rgba(18, 151, 243, 0.2);
    border-radius: 8px;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 600;
    color: var(--rf-navy);
    margin-bottom: 28px;
}

.rfsf-emg-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: var(--rf-blue);
    border-radius: 50%;
    flex-shrink: 0;
    animation: rfsf-blink 1.3s ease-in-out infinite;
}

@keyframes rfsf-blink {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.2; }
}

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

.rfsf-emergency-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(18, 151, 243, 0.15);
}

.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(18, 151, 243, 0.15) !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: var(--rf-blue);
    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 6px 20px rgba(18, 151, 243, 0.35);
    white-space: nowrap;
}

.rfsf-submit:hover:not(:disabled) {
    background: #0d82d4;
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(18, 151, 243, 0.45);
}

.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(18, 151, 243, 0.3);
}

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

/* ---- 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%;
    }
}
