/* FundWise Screening Assistant - Frontend */
.fwsa-wrap {
    --fwsa-bg: #f5f7fb;
    --fwsa-card: #ffffff;
    --fwsa-text: #172033;
    --fwsa-muted: #667085;
    --fwsa-border: #e6eaf2;
    --fwsa-soft: #f1f5fb;
    --fwsa-primary: #1f5eff;
    --fwsa-primary-dark: #1646c7;
    --fwsa-green: #0f9f6e;
    --fwsa-red: #d92d20;
    --fwsa-shadow: 0 24px 70px rgba(15, 23, 42, 0.12);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Tahoma, Arial, sans-serif;
    color: var(--fwsa-text);
    margin: 32px 0;
}

.fwsa-wrap[dir="rtl"] {
    font-family: Tahoma, "Segoe UI", Arial, sans-serif;
}

.fwsa-wrap * {
    box-sizing: border-box;
}

.fwsa-shell {
    max-width: 1120px;
    margin: 0 auto;
    background:
        radial-gradient(circle at top left, rgba(31, 94, 255, 0.13), transparent 34%),
        linear-gradient(145deg, #ffffff 0%, #f9fbff 100%);
    border: 1px solid rgba(230, 234, 242, 0.9);
    border-radius: 28px;
    box-shadow: var(--fwsa-shadow);
    overflow: hidden;
}

.fwsa-hero {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: flex-start;
    padding: 34px 36px 26px;
    background: linear-gradient(135deg, #f8fbff 0%, #eef4ff 100%);
    border-bottom: 1px solid var(--fwsa-border);
}

.fwsa-kicker {
    display: inline-flex;
    align-items: center;
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(31, 94, 255, 0.09);
    color: var(--fwsa-primary);
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 12px;
}

.fwsa-hero h2 {
    margin: 0 0 8px;
    font-size: clamp(24px, 3vw, 34px);
    line-height: 1.25;
    color: var(--fwsa-text);
}

.fwsa-hero p {
    max-width: 720px;
    margin: 0;
    color: var(--fwsa-muted);
    font-size: 15px;
    line-height: 1.8;
}

.fwsa-lang-switch {
    display: inline-flex;
    padding: 5px;
    background: #fff;
    border: 1px solid var(--fwsa-border);
    border-radius: 999px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
    flex-shrink: 0;
}

.fwsa-lang-btn {
    appearance: none;
    border: 0;
    background: transparent;
    border-radius: 999px;
    padding: 9px 16px;
    cursor: pointer;
    color: var(--fwsa-muted);
    font-weight: 800;
    transition: 0.2s ease;
}

.fwsa-lang-btn:hover,
.fwsa-lang-btn.is-active {
    background: var(--fwsa-primary);
    color: #fff;
}

.fwsa-alert {
    margin: 24px 36px 0;
    padding: 16px 18px;
    border-radius: 18px;
    display: flex;
    gap: 10px;
    flex-direction: column;
    line-height: 1.7;
}

.fwsa-alert-success {
    background: #ecfdf3;
    border: 1px solid #abefc6;
    color: #067647;
}

.fwsa-alert-error {
    background: #fff1f3;
    border: 1px solid #fecdd6;
    color: #b42318;
}

.fwsa-form {
    padding: 28px 36px 36px;
}

.fwsa-progress {
    background: #fff;
    border: 1px solid var(--fwsa-border);
    border-radius: 20px;
    padding: 16px;
    margin-bottom: 18px;
}

.fwsa-progress-top {
    display: flex;
    justify-content: space-between;
    color: var(--fwsa-muted);
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 10px;
}

.fwsa-progress-top strong {
    color: var(--fwsa-text);
}

.fwsa-progress-track {
    height: 9px;
    border-radius: 999px;
    background: #e9edf5;
    overflow: hidden;
}

.fwsa-progress-fill {
    display: block;
    height: 100%;
    width: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--fwsa-primary), #7c3aed);
    transition: width 0.25s ease;
}

.fwsa-step-tabs {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 24px;
}

.fwsa-step-tab {
    border: 1px solid var(--fwsa-border);
    background: rgba(255, 255, 255, 0.82);
    border-radius: 16px;
    padding: 10px 8px;
    cursor: pointer;
    min-height: 72px;
    transition: 0.18s ease;
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: center;
    justify-content: center;
    color: var(--fwsa-muted);
}

.fwsa-step-tab:hover {
    transform: translateY(-2px);
    border-color: rgba(31, 94, 255, 0.35);
    box-shadow: 0 12px 26px rgba(15, 23, 42, 0.08);
}

.fwsa-step-tab span {
    display: inline-flex;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    background: var(--fwsa-soft);
    color: var(--fwsa-muted);
    font-size: 13px;
    font-weight: 900;
}

.fwsa-step-tab em {
    font-style: normal;
    font-size: 12px;
    line-height: 1.25;
    font-weight: 800;
    text-align: center;
}

.fwsa-step-tab.is-active {
    background: #fff;
    border-color: var(--fwsa-primary);
    color: var(--fwsa-primary);
}

.fwsa-step-tab.is-active span {
    background: var(--fwsa-primary);
    color: #fff;
}

.fwsa-step {
    display: none;
    animation: fwsaFade 0.25s ease;
}

.fwsa-step.is-active {
    display: block;
}

@keyframes fwsaFade {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.fwsa-section-head {
    margin: 4px 0 22px;
}

.fwsa-section-head h3 {
    margin: 0 0 8px;
    font-size: 24px;
    color: var(--fwsa-text);
}

.fwsa-section-head p {
    margin: 0;
    color: var(--fwsa-muted);
    line-height: 1.8;
}

.fwsa-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.fwsa-field {
    position: relative;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid var(--fwsa-border);
    border-radius: 18px;
    padding: 16px;
    transition: 0.18s ease;
}

.fwsa-field:hover,
.fwsa-field:focus-within {
    border-color: rgba(31, 94, 255, 0.45);
    box-shadow: 0 14px 30px rgba(31, 94, 255, 0.09);
    transform: translateY(-1px);
}

.fwsa-field-wide {
    grid-column: 1 / -1;
}

.fwsa-label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    color: #27364f;
    font-weight: 900;
    font-size: 14px;
    line-height: 1.65;
}

.fwsa-label sup {
    color: var(--fwsa-red);
    font-size: 14px;
    line-height: 1;
}

.fwsa-help {
    width: 21px;
    height: 21px;
    border: 0;
    border-radius: 50%;
    background: #edf3ff;
    color: var(--fwsa-primary);
    font-weight: 900;
    cursor: help;
    line-height: 21px;
    padding: 0;
}

.fwsa-tooltip {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    z-index: 5;
    top: 44px;
    inset-inline-start: 16px;
    width: min(330px, calc(100% - 32px));
    padding: 12px 13px;
    border-radius: 14px;
    background: #111827;
    color: #fff;
    font-size: 12px;
    line-height: 1.7;
    font-weight: 500;
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.25);
    transition: 0.16s ease;
}

.fwsa-help:hover + .fwsa-tooltip,
.fwsa-help:focus + .fwsa-tooltip {
    visibility: visible;
    opacity: 1;
    transform: translateY(3px);
}

.fwsa-field input[type="text"],
.fwsa-field input[type="email"],
.fwsa-field input[type="tel"],
.fwsa-field input[type="number"],
.fwsa-field input[type="date"],
.fwsa-field select,
.fwsa-field textarea {
    width: 100%;
    border: 1px solid #d7ddea;
    border-radius: 14px;
    background: #fbfcff;
    color: var(--fwsa-text);
    padding: 13px 14px;
    min-height: 48px;
    outline: none;
    transition: 0.18s ease;
    font-size: 14px;
}

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

.fwsa-field input:focus,
.fwsa-field select:focus,
.fwsa-field textarea:focus {
    border-color: var(--fwsa-primary);
    box-shadow: 0 0 0 4px rgba(31, 94, 255, 0.12);
    background: #fff;
}

.fwsa-choice-group {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.fwsa-choice {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
    border: 1px solid #dfe5f0;
    border-radius: 14px;
    background: #fbfcff;
    cursor: pointer;
    min-height: 48px;
    line-height: 1.6;
    transition: 0.18s ease;
}

.fwsa-choice:hover {
    border-color: rgba(31, 94, 255, 0.45);
    background: #f7faff;
}

.fwsa-choice input {
    margin-top: 4px;
    accent-color: var(--fwsa-primary);
}

.fwsa-file {
    border: 1px dashed #b9c4d6;
    border-radius: 16px;
    padding: 14px;
    background: #f8fbff;
}

.fwsa-file input {
    display: block;
    width: 100%;
    margin-bottom: 8px;
}

.fwsa-file small {
    color: var(--fwsa-muted);
    line-height: 1.6;
}

.fwsa-form-error {
    display: none;
    margin: 20px 0 0;
    padding: 13px 15px;
    border-radius: 14px;
    background: #fff1f3;
    border: 1px solid #fecdd6;
    color: #b42318;
    font-weight: 700;
}

.fwsa-form-error.is-active {
    display: block;
}

.fwsa-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 26px;
    padding-top: 22px;
    border-top: 1px solid var(--fwsa-border);
}

.fwsa-wrap[dir="rtl"] .fwsa-actions {
    justify-content: flex-start;
}

.fwsa-btn {
    appearance: none;
    border: 0;
    border-radius: 14px;
    padding: 13px 24px;
    font-weight: 900;
    cursor: pointer;
    transition: 0.18s ease;
    min-width: 118px;
}

.fwsa-btn:hover {
    transform: translateY(-1px);
}

.fwsa-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
}

.fwsa-btn-primary {
    background: linear-gradient(135deg, var(--fwsa-primary), #6d28d9);
    color: #fff;
    box-shadow: 0 14px 28px rgba(31, 94, 255, 0.25);
}

.fwsa-btn-primary:hover {
    background: linear-gradient(135deg, var(--fwsa-primary-dark), #5b21b6);
}

.fwsa-btn-ghost {
    background: #fff;
    color: var(--fwsa-text);
    border: 1px solid var(--fwsa-border);
}

.fwsa-submit {
    display: none;
}

.fwsa-wrap.is-final-step .fwsa-next {
    display: none;
}

.fwsa-wrap.is-final-step .fwsa-submit {
    display: inline-flex;
    justify-content: center;
}

.fwsa-wrap[data-fwsa-lang="en"] {
    direction: ltr;
}

.fwsa-wrap[data-fwsa-lang="fa"] {
    direction: rtl;
}

@media (max-width: 980px) {
    .fwsa-hero {
        flex-direction: column;
    }

    .fwsa-step-tabs {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .fwsa-grid {
        grid-template-columns: 1fr;
    }

    .fwsa-choice-group {
        grid-template-columns: 1fr;
    }

    .fwsa-form,
    .fwsa-hero {
        padding-left: 22px;
        padding-right: 22px;
    }
}

@media (max-width: 560px) {
    .fwsa-shell {
        border-radius: 18px;
    }

    .fwsa-step-tabs {
        grid-template-columns: 1fr;
    }

    .fwsa-actions {
        flex-direction: column-reverse;
    }

    .fwsa-btn {
        width: 100%;
    }

    .fwsa-lang-switch {
        width: 100%;
        justify-content: center;
    }

    .fwsa-lang-btn {
        flex: 1;
    }
}

.fwsa-invalid,
.fwsa-invalid-box {
    border-color: #f04438 !important;
    box-shadow: 0 0 0 4px rgba(240, 68, 56, 0.12) !important;
}
