/* ========== ONBOARDING WIZARD ========== */

.onboarding-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--bg-body);
    z-index: 1100;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    overflow-y: auto;
    animation: onboardingFadeIn 0.5s ease;
}

@keyframes onboardingFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.onboarding-overlay::before {
    content: '';
    position: fixed;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background:
        radial-gradient(ellipse at 20% 20%, rgba(138, 42, 86, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(110, 234, 255, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(26, 29, 90, 0.5) 0%, transparent 70%);
    animation: bgShift 20s ease-in-out infinite alternate;
    z-index: -1;
    pointer-events: none;
}

[data-theme="light"] .onboarding-overlay::before {
    opacity: 0;
}

/* ========== STEP INDICATOR ========== */

.onboarding-step-indicator {
    display: flex;
    gap: 48px;
    margin-bottom: 40px;
    position: relative;
}

.onboarding-step-indicator::before {
    content: '';
    position: absolute;
    top: 14px;
    left: 30px;
    right: 30px;
    height: 2px;
    background: var(--border-divider-strong);
    z-index: 0;
}

.onboarding-dot {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    position: relative;
    z-index: 1;
}

.onboarding-dot-circle {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid var(--text-muted);
    background: var(--bg-body);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 12px;
    font-weight: 700;
    color: transparent;
}

.onboarding-dot.active .onboarding-dot-circle {
    border-color: var(--cyan);
    background: var(--cyan);
    box-shadow: 0 0 16px var(--cyan-glow), 0 0 32px rgba(110, 234, 255, 0.1);
    color: var(--bg-body);
}

.onboarding-dot.completed .onboarding-dot-circle {
    border-color: var(--green);
    background: var(--green);
    box-shadow: 0 0 12px var(--green-bg);
    color: #fff;
}

.onboarding-dot-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    font-weight: 600;
    white-space: nowrap;
    transition: color 0.3s ease;
}

.onboarding-dot.active .onboarding-dot-label {
    color: var(--cyan);
}

.onboarding-dot.completed .onboarding-dot-label {
    color: var(--green);
}

/* ========== CARD ========== */

.onboarding-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    padding: 48px 44px;
    backdrop-filter: blur(16px);
    width: 100%;
    max-width: 640px;
    max-height: calc(100vh - 180px);
    overflow-y: auto;
    animation: onboardingCardIn 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes onboardingCardIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.onboarding-card::-webkit-scrollbar {
    width: 4px;
}

.onboarding-card::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: 4px;
}

/* ========== WELCOME STEP ========== */

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

.onboarding-logo-mark {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--magenta), var(--magenta-light));
    border-radius: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    font-weight: 800;
    color: #fff;
    margin: 0 auto 28px;
    box-shadow: 0 8px 40px var(--magenta-glow);
    animation: logoPulse 2s ease-in-out infinite alternate;
}

@keyframes logoPulse {
    from { box-shadow: 0 8px 40px var(--magenta-glow); }
    to { box-shadow: 0 12px 60px rgba(138, 42, 86, 0.45); }
}

.onboarding-title {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 12px;
    letter-spacing: -0.5px;
    color: var(--text-primary);
}

.onboarding-subtitle {
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 36px;
    line-height: 1.7;
}

.onboarding-features {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 36px;
    text-align: left;
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
}

.onboarding-feature-item {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.onboarding-feature-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: var(--green-bg);
    color: var(--green);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}

/* ========== ACTION BUTTONS ========== */

.onboarding-action-btn {
    padding: 14px 36px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 12px;
}

.onboarding-action-btn.full-width {
    width: 100%;
}

/* ========== STEP CONTENT (Steps 1 & 2) ========== */

.onboarding-step-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.onboarding-step-title {
    font-size: 22px;
    font-weight: 700;
    text-align: center;
    color: var(--text-primary);
    margin-bottom: 0;
}

.onboarding-step-desc {
    font-size: 14px;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 8px;
    line-height: 1.6;
}

.onboarding-step-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border-divider-strong);
}

/* ========== USER LIST ========== */

.onboarding-user-list {
    max-height: 320px;
    overflow-y: auto;
    border-radius: 12px;
    border: 1px solid var(--border-subtle);
}

.onboarding-user-list .data-table {
    margin: 0;
}

.onboarding-user-count {
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
    margin-top: 8px;
}

/* ========== SUCCESS STEP ========== */

.onboarding-success {
    text-align: center;
    padding: 20px 0;
}

.onboarding-success-icon {
    font-size: 72px;
    margin-bottom: 8px;
    animation: successBounce 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes successBounce {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); opacity: 1; }
}

.onboarding-summary {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.onboarding-summary-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 10px;
    background: var(--bg-hover-strong);
    font-size: 13px;
    color: var(--text-secondary);
}

.onboarding-summary-item .count {
    font-weight: 700;
    color: var(--cyan);
}

/* ========== CONFETTI ========== */

.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1200;
    overflow: hidden;
}

.confetti-piece {
    position: absolute;
    top: -20px;
    width: 8px;
    height: 16px;
    border-radius: 2px;
    opacity: 0;
    animation: confettiFall linear forwards;
}

@keyframes confettiFall {
    0% {
        transform: translateY(-20px) rotateZ(0deg) rotateX(0deg);
        opacity: 1;
    }
    75% {
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotateZ(720deg) rotateX(360deg);
        opacity: 0;
    }
}

/* ========== LOADING STATE ========== */

.onboarding-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 40px 0;
}

.onboarding-loading .spinner {
    width: 36px;
    height: 36px;
}

.onboarding-loading p {
    font-size: 13px;
    color: var(--text-muted);
}

/* ========== RESPONSIVE ========== */

@media (max-width: 640px) {
    .onboarding-overlay {
        padding: 16px;
    }

    .onboarding-card {
        padding: 32px 24px;
        border-radius: 20px;
    }

    .onboarding-step-indicator {
        gap: 24px;
    }

    .onboarding-dot-label {
        display: none;
    }

    .onboarding-title {
        font-size: 22px;
    }

    .onboarding-step-title {
        font-size: 18px;
    }

    .onboarding-step-actions {
        flex-direction: column-reverse;
    }

    .onboarding-step-actions .btn {
        width: 100%;
        text-align: center;
    }

    .onboarding-logo-mark {
        width: 64px;
        height: 64px;
        font-size: 28px;
    }

    .onboarding-summary {
        flex-direction: column;
    }
}
