/* Onboarding Funnel Styles */
.onboarding-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(5, 10, 15, 0.98);
    backdrop-filter: blur(20px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.onboarding-overlay.active {
    opacity: 1;
    visibility: visible;
}

.onboarding-card {
    width: 90%;
    max-width: 600px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 4rem;
    position: relative;
    box-shadow: 0 40px 100px rgba(0,0,0,0.5);
    transform: translateY(30px);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    /* clip the progress bar to the card's rounded corners so it reads as
       attached rather than floating above */
    overflow: hidden;
}

/* Subtle progress track sits flush with the top edge so even at step 1
   the user sees the full path the bar will fill */
.onboarding-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: rgba(255, 255, 255, 0.06);
    pointer-events: none;
}

.onboarding-overlay.active .onboarding-card {
    transform: translateY(0);
}

.onboarding-step {
    display: none;
    animation: fadeInSlide 0.5s forwards;
}

.onboarding-step.active {
    display: block;
}

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

.onboarding-card h2 {
    font-size: 1.8rem;
    margin-bottom: 2rem;
    color: var(--text-white);
    letter-spacing: -0.5px;
}

.choice-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.choice-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-white);
    padding: 2rem;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.choice-btn:hover {
    background: var(--accent);
    border-color: var(--accent);
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(204, 122, 0, 0.2);
}

.onboarding-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1.2rem;
    border-radius: 8px;
    color: var(--text-white);
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

.onboarding-textarea {
    width: 100%;
    height: 150px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1.2rem;
    border-radius: 8px;
    color: var(--text-white);
    font-size: 1.1rem;
    margin-bottom: 2rem;
    resize: none;
}

.onboarding-card .btn-next {
    width: 100%;
    background: var(--accent);
    color: var(--text-white);
    padding: 1.2rem;
    border-radius: 8px;
    font-weight: 800;
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

.onboarding-card .btn-next:hover {
    filter: brightness(1.2);
}

.progress-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 4px;
    background: var(--accent);
    box-shadow: 0 0 10px rgba(204, 122, 0, 0.5);
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
}

.back-btn {
    position: absolute;
    top: 1.5rem;
    left: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 1px;
}

.close-onboarding {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.5rem;
}

.onboarding-success {
    text-align: center;
}

.success-icon {
    font-size: 4rem;
    margin-bottom: 2rem;
}

/* Validation Styling */
.input-error {
    border-color: #ff4d4d !important;
    background: rgba(255, 77, 77, 0.05) !important;
}

.error-msg {
    color: #ff4d4d;
    font-size: 0.8rem;
    margin-top: -1.5rem;
    margin-bottom: 1.5rem;
    display: block;
}

/* =========================================================
   Onboarding modal on mobile
   The desktop card has 4rem padding which crushes content on phones.
   Tighten everything and let the card scroll if content overflows.
   ========================================================= */
@media (max-width: 600px) {
    .onboarding-overlay {
        padding: 1rem;
        align-items: flex-start;
    }
    .onboarding-card {
        width: 100%;
        max-width: 100%;
        padding: 3rem 1.5rem 2rem;
        border-radius: 16px;
        max-height: calc(100vh - 2rem);
        overflow-y: auto;
        margin: 0;
    }
    .onboarding-card h2 {
        font-size: 1.25rem;
        margin-bottom: 1.5rem;
        margin-top: 0.5rem;
        line-height: 1.3;
    }
    .choice-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
    }
    .choice-btn {
        padding: 1.25rem 0.75rem;
        font-size: 0.9rem;
        border-radius: 10px;
    }
    .onboarding-input,
    .onboarding-textarea {
        font-size: 1rem;
        padding: 0.9rem;
        margin-bottom: 1.25rem;
    }
    .onboarding-textarea {
        height: 120px;
    }
    .onboarding-card .btn-next {
        padding: 0.95rem;
        font-size: 0.95rem;
    }
    .back-btn {
        top: 0.85rem;
        left: 1rem;
        font-size: 0.7rem;
    }
    .close-onboarding {
        top: 0.6rem;
        right: 1rem;
        font-size: 1.6rem;
    }
    .onboarding-success {
        padding: 1rem 0;
    }
    .success-icon {
        font-size: 3rem;
        margin-bottom: 1rem;
    }
    /* The level step has 5 choices; let them stack 1-per-row on tiny phones */
    .choice-grid:has(.choice-btn:nth-child(5)) {
        grid-template-columns: 1fr;
    }
}
