/* ============================================================
   LeanSpace Financial Scan v1.0
   Pre-onboarding savings wizard — Apple-style dark overlay
   ============================================================ */

/* --- Overlay (full-screen backdrop) --- */
.fs-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: linear-gradient(150deg, #f0f4ff 0%, #fafbff 40%, #edfbf6 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-y: auto;
    animation: fs-fade-in 0.25s ease;
}

@keyframes fs-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* --- Card --- */
.fs-card {
    background: #ffffff;
    border-radius: 20px;
    max-width: 560px;
    width: 100%;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    box-shadow: 0 8px 40px rgba(79, 70, 229, 0.10), 0 2px 12px rgba(0,0,0,0.05);
    animation: fs-slide-up 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes fs-slide-up {
    from { transform: translateY(32px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

/* Scrollbar styling for card */
.fs-card::-webkit-scrollbar { width: 4px; }
.fs-card::-webkit-scrollbar-track { background: transparent; }
.fs-card::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 2px; }

/* --- Header --- */
.fs-header {
    padding: 20px 24px 12px;
    text-align: center;
}

/* --- Progress dots --- */
.fs-dots {
    display: flex;
    flex-direction: row;
    gap: 6px;
    justify-content: center;
    margin-bottom: 20px;
}

.fs-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #e5e7eb;
    transition: background 0.2s ease, transform 0.2s ease;
}

.fs-dot.active {
    background: #0071e3;
    transform: scale(1.3);
}

.fs-dot.done {
    background: #34d399;
}

/* --- Question icon --- */
.fs-question-icon {
    font-size: 40px;
    line-height: 1;
    margin-bottom: 12px;
}

/* --- Question title --- */
.fs-question-title {
    font-size: 20px;
    font-weight: 600;
    color: #1d1d1f;
    margin-bottom: 8px;
    line-height: 1.3;
}

/* --- Question description --- */
.fs-question-desc {
    font-size: 13px;
    color: #6e6e73;
    margin-bottom: 4px;
    line-height: 1.4;
}

/* --- Answer options --- */
.fs-options {
    padding: 0 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.fs-option {
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 14px 16px;
    cursor: pointer;
    font-size: 14px;
    text-align: left;
    background: #ffffff;
    color: #1d1d1f;
    width: 100%;
    min-height: 48px;
    transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
    line-height: 1.4;
    font-family: inherit;
}

.fs-option:hover {
    border-color: #0071e3;
    background: #f0f7ff;
}

.fs-option.selected {
    border-color: #0071e3;
    background: #eff6ff;
    color: #0071e3;
    font-weight: 500;
}

/* --- Footer --- */
.fs-footer {
    padding: 20px 24px 24px;
    text-align: center;
}

/* --- Next button --- */
.fs-next-btn {
    display: block;
    width: 100%;
    height: 48px;
    border-radius: 12px;
    background: #0071e3;
    color: #ffffff;
    font-size: 15px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s ease, opacity 0.15s ease;
}

.fs-next-btn:hover:not(:disabled) {
    background: #0063c8;
}

.fs-next-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* --- Skip link --- */
.fs-skip-link {
    font-size: 12px;
    color: #9ca3af;
    cursor: pointer;
    display: block;
    margin-top: 12px;
    transition: color 0.15s ease;
    user-select: none;
}

.fs-skip-link:hover {
    color: #6b7280;
}

/* ============================================================
   Results screen
   ============================================================ */

.fs-results {
    padding: 0 24px 16px;
}

/* --- Total savings block --- */
.fs-results-total {
    text-align: center;
    margin-bottom: 14px;
    padding: 14px 16px;
    background: #f0fdf4;
    border-radius: 12px;
    border: 1px solid #bbf7d0;
}

.fs-results-amount {
    font-size: 42px;
    font-weight: 700;
    color: #16a34a;
    line-height: 1;
    letter-spacing: -0.5px;
}

.fs-results-label {
    font-size: 13px;
    color: #6e6e73;
    margin-top: 4px;
}

/* --- Category list --- */
.fs-categories-list {
    margin-bottom: 2px;
}

.fs-category-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 7px 0;
    border-bottom: 1px solid #f3f4f6;
}

.fs-category-row:last-child {
    border-bottom: none;
}

.fs-cat-icon {
    font-size: 20px;
    width: 28px;
    text-align: center;
    flex-shrink: 0;
}

.fs-cat-info {
    flex: 1;
    min-width: 0;
}

.fs-cat-title {
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fs-cat-bar {
    height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
    margin-top: 5px;
}

.fs-cat-bar-fill {
    height: 100%;
    background: #0071e3;
    border-radius: 2px;
    transition: width 0.6s ease;
}

.fs-cat-formula {
    font-size: 11px;
    color: #9ca3af;
    margin-top: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fs-cat-amount {
    font-size: 14px;
    font-weight: 600;
    color: #1d1d1f;
    white-space: nowrap;
    flex-shrink: 0;
}

/* --- Start CTA button --- */
.fs-start-btn {
    display: block;
    width: 100%;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, #0071e3 0%, #0051a2 100%);
    color: #ffffff;
    font-size: 15px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    font-family: inherit;
    margin-top: 12px;
    transition: opacity 0.15s ease, transform 0.1s ease;
    letter-spacing: 0.1px;
}

.fs-start-btn:hover {
    opacity: 0.92;
    transform: translateY(-1px);
}

.fs-start-btn:active {
    transform: translateY(0);
}

/* --- Legal disclaimer --- */
.fs-disclaimer {
    font-size: 11px;
    color: #9ca3af;
    text-align: center;
    margin-top: 12px;
    line-height: 1.5;
}

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 560px) {
    .fs-card {
        border-radius: 16px;
        max-height: 95vh;
    }

    .fs-header {
        padding: 20px 18px 12px;
    }

    .fs-options {
        padding: 0 18px;
    }

    .fs-footer {
        padding: 16px 18px 20px;
    }

    .fs-results {
        padding: 0 18px 20px;
    }

    .fs-results-amount {
        font-size: 38px;
    }

    .fs-question-title {
        font-size: 17px;
    }

    .fs-cat-formula {
        display: none;
    }
}
