/* ============================================================
   ONBOARDING — Checklist card + Setup wizard overlay
   Enterprise-grade styling using the ShowRunner design system.
   ============================================================ */

/* ----- Getting Started Checklist Card ----- */
.onboarding-checklist {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-left: 3px solid var(--primary);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.checklist-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--border);
}

.checklist-header h3 {
    margin: 0;
    font-size: var(--font-size-base);
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.checklist-header h3 svg {
    color: var(--primary);
    flex-shrink: 0;
}

.checklist-progress {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.checklist-progress-bar {
    width: 100px;
    height: 4px;
    background: var(--gray-200);
    border-radius: 2px;
    overflow: hidden;
}

.checklist-progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 2px;
    transition: width var(--transition-slow);
}

.checklist-progress-text {
    font-size: var(--font-size-xs);
    font-weight: 700;
    color: var(--text-muted);
    white-space: nowrap;
}

.checklist-items {
    padding: 0.25rem 0;
}

.checklist-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    font-size: var(--font-size-md);
    color: var(--text);
    text-decoration: none;
    transition: background var(--transition-fast);
    cursor: pointer;
    border-left: 2px solid transparent;
}

.checklist-item:hover {
    background: var(--gray-50);
    border-left-color: var(--primary-light);
}

.checklist-item .check-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1.5px solid var(--gray-300);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0;
    transition: all var(--transition);
    color: transparent;
}

.checklist-item.done .check-icon {
    background: var(--success);
    border-color: var(--success);
    color: #fff;
}

.checklist-item.done .check-icon svg {
    width: 12px;
    height: 12px;
}

.checklist-item .check-label {
    flex: 1;
    font-weight: 500;
}

.checklist-item.done .check-label {
    color: var(--text-muted);
    text-decoration: line-through;
}

.checklist-item .check-arrow {
    color: var(--gray-300);
    opacity: 0;
    transition: opacity var(--transition-fast);
    flex-shrink: 0;
}

.checklist-item:hover .check-arrow {
    opacity: 1;
}

.checklist-footer {
    padding: 0.5rem 1rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
}


/* ----- Onboarding Wizard Overlay ----- */
.onboarding-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    animation: onb-fade-in 0.2s ease-out;
}

@keyframes onb-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes onb-slide-up {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

.onboarding-wizard {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 580px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    animation: onb-slide-up 0.25s ease-out;
}

/* Wizard Header */
.wizard-header {
    padding: 1.25rem 1.5rem 1rem;
    border-bottom: 1px solid var(--border);
}

.wizard-header h2 {
    margin: 0 0 1rem;
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--text);
}

/* Step Indicator */
.wizard-steps {
    display: flex;
    gap: 0;
    position: relative;
}

.wizard-steps .step {
    flex: 1;
    text-align: center;
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--gray-400);
    padding: 0.5rem 0;
    position: relative;
    transition: color var(--transition);
}

.wizard-steps .step::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gray-200);
    border-radius: 1px;
    transition: background var(--transition);
}

.wizard-steps .step.active {
    color: var(--primary);
}

.wizard-steps .step.active::after {
    background: var(--primary);
}

/* Wizard Body */
.wizard-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.wizard-body h3 {
    margin: 0 0 1rem;
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.wizard-body .text-muted {
    font-size: var(--font-size-md);
    color: var(--text-muted);
    margin: -0.5rem 0 1rem;
}

.wizard-body .badge {
    display: inline-block;
    font-size: var(--font-size-xs);
    font-weight: 700;
    color: var(--text-muted);
    background: var(--gray-100);
    border: 1px solid var(--gray-200);
    padding: 0.1rem 0.5rem;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    vertical-align: middle;
}

/* Form groups inside wizard */
.wizard-body .form-group {
    margin-bottom: 0.875rem;
}

.wizard-body .form-group label {
    display: block;
    font-size: var(--font-size-sm);
    font-weight: 700;
    color: var(--gray-700);
    margin-bottom: 0.3rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.wizard-body .form-group input,
.wizard-body .form-group select,
.wizard-body .form-group textarea {
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: var(--font-size-base);
    font-family: var(--font);
    color: var(--text);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    outline: none;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    box-sizing: border-box;
}

.wizard-body .form-group input:focus,
.wizard-body .form-group select:focus,
.wizard-body .form-group textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.wizard-body .form-group input::placeholder,
.wizard-body .form-group textarea::placeholder {
    color: var(--gray-400);
}

/* Invite rows */
.invite-row {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.invite-row .invite-email {
    flex: 1;
    padding: 0.5rem 0.75rem;
    font-size: var(--font-size-base);
    font-family: var(--font);
    color: var(--text);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    outline: none;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.invite-row .invite-email:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.invite-row .invite-email::placeholder {
    color: var(--gray-400);
}

.invite-row .invite-role {
    width: 160px;
    padding: 0.5rem 0.75rem;
    font-size: var(--font-size-base);
    font-family: var(--font);
    color: var(--text);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    outline: none;
    cursor: pointer;
}

.invite-row .invite-role:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Wizard Footer */
.wizard-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 1.5rem;
    border-top: 1px solid var(--border);
    gap: 0.75rem;
}

.wizard-footer > div {
    display: flex;
    gap: 0.5rem;
}


/* ----- Upgrade Modal ----- */
.upgrade-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    animation: onb-fade-in 0.2s ease-out;
}

.upgrade-modal {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 420px;
    padding: 2rem;
    text-align: center;
    animation: onb-slide-up 0.25s ease-out;
}

.upgrade-modal-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    background: var(--warning-light);
    color: var(--warning);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.upgrade-modal h3 {
    margin: 0 0 0.5rem;
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--text);
}

.upgrade-modal p {
    margin: 0 0 1.5rem;
    font-size: var(--font-size-md);
    color: var(--text-muted);
    line-height: 1.5;
}

.upgrade-modal-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}


/* ----- Subscription & Billing ----- */
.subscription-page {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.sub-trial-banner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--warning-light);
    border: 1px solid var(--warning);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-md);
    color: var(--text);
}

.sub-trial-banner strong {
    color: var(--warning);
}

.sub-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.sub-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
}

.sub-section-header h4 {
    margin: 0;
    font-size: var(--font-size-base);
    font-weight: 700;
    color: var(--text);
}

.sub-status {
    display: inline-block;
    font-size: var(--font-size-xs);
    font-weight: 700;
    padding: 0.15rem 0.6rem;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.sub-status--active {
    background: var(--success-light);
    color: var(--success);
}

.sub-status--trial {
    background: var(--warning-light);
    color: var(--warning);
}

.sub-status--expired {
    background: var(--danger-light);
    color: var(--danger);
}

.sub-status--cancelled {
    background: var(--gray-100);
    color: var(--gray-500);
}

.sub-current-plan {
    padding: 1.25rem 1rem;
}

.sub-plan-name {
    font-size: var(--font-size-2xl);
    font-weight: 900;
    color: var(--text);
    margin-bottom: 0.25rem;
}

.sub-plan-price {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--primary);
}

.sub-plan-price span {
    font-size: var(--font-size-sm);
    font-weight: 400;
    color: var(--text-muted);
}

.sub-plan-annual {
    font-size: var(--font-size-sm);
    margin-top: 0.2rem;
}

/* Usage meters */
.sub-usage-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
    padding: 1rem;
}

.sub-usage-item {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.sub-usage-label {
    display: flex;
    justify-content: space-between;
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--text);
}

.sub-usage-value {
    font-weight: 700;
    color: var(--gray-600);
}

.sub-usage-value.at-limit {
    color: var(--danger);
}

.sub-usage-bar {
    height: 6px;
    background: var(--gray-200);
    border-radius: 3px;
    overflow: hidden;
}

.sub-usage-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 3px;
    transition: width var(--transition-slow);
}

.sub-usage-fill.near-limit {
    background: var(--warning);
}

.sub-usage-fill.at-limit {
    background: var(--danger);
}

.sub-usage-unlimited {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    font-weight: 600;
}

/* Plan cards grid */
.sub-plans-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    padding: 1rem;
}

.sub-plan-card {
    position: relative;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem 1rem;
    text-align: center;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.sub-plan-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}

.sub-plan-card.current {
    border-color: var(--primary);
    background: var(--primary-50);
}

.sub-plan-card.popular {
    border-color: var(--primary);
}

.sub-plan-badge {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    color: #fff;
    font-size: var(--font-size-xs);
    font-weight: 700;
    padding: 0.15rem 0.75rem;
    border-radius: 10px;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.sub-plan-card h5 {
    margin: 0.5rem 0 0.35rem;
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: var(--text);
}

.sub-plan-card-price {
    font-size: var(--font-size-2xl);
    font-weight: 900;
    color: var(--text);
    margin-bottom: 0.75rem;
}

.sub-plan-card-price span {
    font-size: var(--font-size-sm);
    font-weight: 400;
    color: var(--text-muted);
}

.sub-plan-features {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem;
    text-align: left;
}

.sub-plan-features li {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.2rem 0;
    font-size: var(--font-size-sm);
    color: var(--gray-700);
}

.sub-plan-features li svg {
    color: var(--success);
    flex-shrink: 0;
}

.sub-plan-card .btn {
    width: 100%;
}

/* Comparison table highlight */
.current-col {
    background: var(--primary-50);
}


/* ----- Responsive ----- */
@media (max-width: 640px) {
    .onboarding-wizard {
        max-width: 100%;
        max-height: 100vh;
        border-radius: 0;
    }

    .wizard-header {
        padding: 1rem;
    }

    .wizard-body {
        padding: 1rem;
    }

    .wizard-footer {
        padding: 0.75rem 1rem;
    }

    .invite-row {
        flex-direction: column;
    }

    .invite-row .invite-role {
        width: 100%;
    }

    .checklist-progress-bar {
        display: none;
    }
}
