/* ========================================
   Debug Pages — Shared Brand System
   Unified tokens & patterns for all debug/onboarding pages
   ======================================== */

/* --- Brand Tokens --- */
:root {
    /* Surfaces */
    --surface-base: #161618;
    --surface-raised: #1c1c1f;
    --surface-card: #222225;
    --surface-hover: #2a2a2d;

    /* Borders */
    --border-subtle: rgba(255,255,255,0.07);
    --border-medium: rgba(255,255,255,0.12);

    /* Text */
    --text-primary: #ebebeb;
    --text-secondary: #b0b0b0;
    --text-faint: #8a8a8a;

    /* Brand */
    --brand-red: #E53030;
    --brand-red-hover: #CC2828;
    --brand-orange: #E67330;
    --brand-orange-hover: #CC5F20;

    /* Functional */
    --color-success: #34d399;
    --color-error: #ef4444;
    --color-warn: #fbbf24;
    --color-info: #60a5fa;

    /* Arrival — success tones for the threshold moment */
    --arrival-glow: rgba(52, 211, 153, 0.4);
    --arrival-warmth: rgba(52, 211, 153, 0.03);
}

/* --- Reset --- */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    background: var(--surface-base);
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    min-height: 100vh;
    line-height: 1.5;
}

/* --- Mode Badge --- */
.mode-badge {
    display: inline-block;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.06em;
    padding: 3px 8px;
    border-radius: 10px;
    text-transform: uppercase;
}
.mode-badge--mock {
    background: rgba(251,191,36,0.12);
    color: var(--color-warn);
}
.mode-badge--live {
    background: rgba(52,211,153,0.12);
    color: var(--color-success);
}

/* --- Info/Token Box --- */
.info-box {
    font-size: 11px;
    padding: 8px 12px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.info-box--success {
    background: rgba(52,211,153,0.08);
    color: var(--color-success);
    border: 1px solid rgba(52,211,153,0.15);
}
.info-box--warn {
    background: rgba(251,191,36,0.08);
    color: var(--color-warn);
    border: 1px solid rgba(251,191,36,0.15);
}
.info-box--neutral {
    background: rgba(255,255,255,0.03);
    color: var(--text-secondary);
    border: 1px solid var(--border-subtle);
}

/* --- Section Title --- */
.section-title {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-primary);
    margin-bottom: 8px;
}

/* --- Form Elements --- */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 16px;
}
.form-group:last-child {
    margin-bottom: 0;
}
.form-label {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-secondary);
}
@media (max-width: 480px) {
    .form-label { font-size: 11px; }
}
.form-input {
    background: var(--surface-card);
    border: 1px solid var(--border-medium);
    border-radius: 4px;
    padding: 10px 12px;
    font-size: 16px; /* Prevents iOS auto-zoom on focus */
    color: var(--text-primary);
    font-family: inherit;
    transition: border-color 0.15s;
    -webkit-appearance: none;
}
.form-input:focus {
    outline: none;
    border-color: var(--brand-red);
}
.form-input.invalid {
    border-color: var(--color-error);
}

/* --- Buttons --- */
.btn-primary {
    width: 100%;
    padding: 14px;
    background: var(--brand-red);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s, opacity 0.15s;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.btn-primary:hover { background: var(--brand-red-hover); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-ghost {
    background: transparent;
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    border-radius: 4px;
    font-size: 11px;
    font-family: inherit;
    cursor: pointer;
    padding: 10px;
    transition: color 0.15s, border-color 0.15s;
}
.btn-ghost:hover {
    color: var(--text-primary);
    border-color: var(--border-medium);
}
.btn-ghost:disabled { opacity: 0.5; cursor: not-allowed; }

/* --- Success State --- */
.success-state {
    text-align: center;
    padding: 40px 20px;
    display: none;
}
.success-state.visible { display: block; }
.success-state__icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 16px;
    background: rgba(52,211,153,0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--color-success);
}
.success-state__title {
    font-size: 15px;
    font-weight: 600;
    color: var(--color-success);
    margin-bottom: 8px;
}
.success-state__detail {
    font-size: 12px;
    color: var(--text-secondary);
}

/* --- Status Badges --- */
.status-badge {
    display: inline-block;
    font-size: 9px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}
.status-badge--active    { background: rgba(52,211,153,0.12); color: var(--color-success); }
.status-badge--new       { background: rgba(96,165,250,0.12); color: var(--color-info); }
.status-badge--failed    { background: rgba(251,191,36,0.12); color: var(--color-warn); }
.status-badge--cancelled { background: rgba(107,114,128,0.15); color: #9ca3af; }

/* --- Debug Panel Mount --- */
.debug-mount {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9000;
}

/* --- Customer Info --- */
.customer-info {
    font-size: 12px;
    color: var(--text-secondary);
    padding: 8px 12px;
    background: rgba(255,255,255,0.03);
    border-radius: 4px;
}
.customer-name {
    color: var(--text-primary);
    font-weight: 600;
}

/* --- Consent Row --- */
.consent-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
    background: var(--surface-raised);
    border-radius: 4px;
    border: 1px solid var(--border-subtle);
}
.consent-checkbox {
    width: 18px;
    height: 18px;
    margin-top: 1px;
    flex-shrink: 0;
    accent-color: var(--brand-red);
}
.consent-label {
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-primary);
    cursor: pointer;
}

/* --- Step Indicator --- */
.step-indicator {
    display: flex;
    gap: 3px;
    align-items: center;
}
.step-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--surface-hover);
    transition: background 0.2s;
}
.step-dot.filled { background: var(--color-success); }
.step-dot.filled.step-dot--cancelled { background: var(--surface-hover); }
.step-dot.current { background: var(--brand-orange); box-shadow: 0 0 4px rgba(230,115,48,0.4); }

/* --- Progress Bar --- */
.progress-bar {
    width: 100%;
    height: 4px;
    background: var(--surface-hover);
    border-radius: 2px;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.4s ease;
    background: var(--brand-red);
}

/* --- Utility --- */
.check-icon { color: var(--color-success); }
.cross-icon { color: var(--text-faint); }

/* ========================================
   Onboarding Wizard — Shared Components
   ======================================== */

/* --- Wizard Layout --- */
.onboard-container {
    max-width: 560px;
    margin: 0 auto;
    padding: 24px 20px;
    padding-bottom: 80px;
    min-height: 100vh;
}
@media (min-width: 768px) {
    .onboard-container {
        padding: 48px 24px;
        padding-bottom: 100px;
    }
}

.onboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-subtle);
}
.onboard-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}
.onboard-logo-text {
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.06em;
    color: var(--text-primary);
}
.logo-dot { color: var(--brand-red); }

#step-indicator .step-dot {
    width: 8px;
    height: 8px;
}

/* --- Wizard Content --- */
.onboard-content {
    animation: fadeInUp 0.3s ease;
}
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Loading State --- */
.onboard-loading {
    text-align: center;
    padding: 60px 20px;
}
.loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border-medium);
    border-top-color: var(--brand-red);
    border-radius: 50%;
    margin: 0 auto 16px;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text {
    font-size: 13px;
    color: var(--text-secondary);
}

/* --- Error State --- */
.onboard-error {
    text-align: center;
    padding: 60px 20px;
}
.error-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 16px;
    background: rgba(239, 68, 68, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    color: var(--color-error);
}
.error-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}
.error-message {
    font-size: 13px;
    color: var(--text-secondary);
}

/* --- Step Titles --- */
.step-title {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin-bottom: 6px;
}
@media (min-width: 768px) {
    .step-title { font-size: 24px; }
}
.step-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 28px;
    line-height: 1.5;
}

/* --- Wizard Form --- */
.wizard-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.form-row--split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
@media (max-width: 480px) {
    .form-row--split { grid-template-columns: 1fr; }
}

/* --- Plan Summary --- */
.plan-summary {
    background: var(--surface-raised);
    border: 1px solid var(--border-medium);
    border-radius: 6px;
    padding: 14px 16px;
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.plan-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}
.plan-price {
    font-size: 14px;
    font-weight: 700;
    color: var(--brand-red);
}

/* --- Payment Timeline --- */
.payment-timeline {
    background: var(--surface-raised);
    border: 1px solid var(--border-medium);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 24px;
}
.pt-section {
    position: relative;
}
.pt-marker {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}
.pt-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}
.pt-dot--now {
    background: var(--text-primary);
}
.pt-dot--future {
    background: transparent;
    border: 2px solid var(--text-faint);
    width: 10px;
    height: 10px;
    box-sizing: border-box;
}
.pt-date {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.pt-connector {
    width: 1px;
    height: 16px;
    background: var(--border-medium);
    margin: 4px 0 4px 4.5px;
}
.pt-details {
    padding-left: 20px;
    margin-bottom: 4px;
}
.pt-line {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 3px 0;
    font-size: 13px;
    color: var(--text-primary);
}
.pt-line--total {
    font-weight: 600;
}
.pt-amount {
    font-variant-numeric: tabular-nums;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    margin-left: 16px;
}
.pt-amount--total {
    color: var(--brand-red);
    font-weight: 700;
    font-size: 14px;
}
.pt-separator {
    height: 1px;
    background: var(--border-medium);
    margin: 8px 0;
}
.pt-recurring {
    font-size: 11px;
    color: var(--text-faint);
    margin-top: 4px;
}
.payment-note {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 20px;
    text-align: center;
}

/* --- Sign Step: Summary Box --- */
.sign-summary-box {
    background: var(--surface-raised);
    border: 1px solid var(--border-medium);
    border-radius: 6px;
    padding: 14px 16px;
    margin-bottom: 16px;
}
.sign-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 4px 0;
    font-size: 13px;
}
.sign-summary-label {
    color: var(--text-faint);
    flex-shrink: 0;
    margin-right: 12px;
}
.sign-summary-value {
    color: var(--text-secondary);
    text-align: right;
}

/* --- Sign Step: Warning Box --- */
.sign-warning-box {
    background: rgba(230, 115, 48, 0.08);
    border: 1px solid var(--brand-orange);
    border-radius: 6px;
    padding: 14px 16px;
    margin-bottom: 20px;
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-primary);
}
.sign-warning-box strong {
    color: var(--brand-orange);
}

/* --- Contract Text Box --- */
.contract-text-box {
    background: var(--surface-raised);
    border: 1px solid var(--border-medium);
    border-radius: 6px;
    padding: 18px;
    max-height: 400px;
    overflow-y: auto;
    font-size: 13px;
    line-height: 1.7;
    color: var(--text-primary);
    scrollbar-width: thin;
    scrollbar-color: var(--surface-hover) transparent;
}
.contract-text-box h4 {
    color: #fff;
    margin-bottom: 12px;
    font-size: 15px;
    font-weight: 600;
}
.contract-text-box h5 {
    color: #fff;
    margin-top: 16px;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.contract-text-box p { margin-bottom: 10px; }
.contract-text-box ul {
    margin: 8px 0 12px 0;
    padding-left: 20px;
}
.contract-text-box li {
    margin-bottom: 6px;
    color: var(--text-secondary);
}
.contract-text-box strong { color: #fff; }
.contract-final-statement {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border-medium);
}

/* --- Signature Canvas --- */
.sig-wrap {
    background: var(--surface-card);
    border: 1px solid var(--border-medium);
    border-radius: 6px;
    position: relative;
    overflow: hidden;
    touch-action: none;
}
.sig-wrap canvas {
    display: block;
    width: 100%;
    height: 150px;
    touch-action: none;
}

/* Prevent body scroll when drawing signature */
body.signature-drawing {
    overflow: hidden;
    touch-action: none;
}
@media (min-width: 768px) {
    .sig-wrap canvas { height: 180px; }
}
.sig-placeholder {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 13px;
    color: var(--text-secondary);
    pointer-events: none;
    transition: opacity 0.2s;
}
.sig-placeholder.hidden { opacity: 0; }
.sig-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 6px;
}
.sig-clear {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
    padding: 4px 8px;
}
.sig-clear:hover { color: var(--text-primary); }

/* --- Discord Card --- */
.discord-card {
    background: var(--surface-raised);
    border: 1px solid var(--border-medium);
    border-radius: 8px;
    padding: 32px 24px;
    text-align: center;
    margin-top: 8px;
}
.discord-icon-wrap {
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    background: rgba(88, 101, 242, 0.1);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.discord-icon-wrap svg {
    width: 30px;
    height: 30px;
    fill: #5865F2;
}
.discord-benefits {
    text-align: left;
    margin: 20px 0 28px;
    padding: 0;
    list-style: none;
}
.discord-benefits li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 0;
    font-size: 13px;
    color: var(--text-primary);
}
.discord-benefits li::before {
    content: "✓";
    color: var(--color-success);
    font-weight: 700;
    flex-shrink: 0;
}
.btn-discord {
    width: 100%;
    padding: 14px;
    background: #5865F2;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s;
    min-height: 48px;
}
.btn-discord:hover { background: #4752C4; }

/* --- Discord Intro Frame --- */
.discord-intro-frame {
    margin-top: 20px;
    padding: 16px 18px;
    background: rgba(88, 101, 242, 0.06);
    border: 1px solid rgba(88, 101, 242, 0.15);
    border-radius: 8px;
}
.discord-intro-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}
.discord-intro-icon {
    font-size: 14px;
    color: #5865F2;
}
.discord-intro-label {
    font-size: 13px;
    font-weight: 600;
    color: #5865F2;
}
.discord-intro-text {
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-primary);
    margin-bottom: 10px;
}
.discord-intro-cta {
    font-size: 12px;
    line-height: 1.5;
    color: var(--text-secondary);
    margin: 0;
}

/* --- Discord Connected Banner --- */
.discord-connected-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: rgba(52, 211, 153, 0.08);
    border: 1px solid rgba(52, 211, 153, 0.2);
    border-radius: 6px;
    margin-bottom: 24px;
}
.discord-connected-icon {
    width: 18px;
    height: 18px;
    color: var(--color-success);
    flex-shrink: 0;
}
.discord-connected-text {
    font-size: 13px;
    font-weight: 500;
    color: var(--color-success);
}

/* --- Teachable Card --- */
.teachable-card {
    background: var(--surface-raised);
    border: 1px solid var(--border-medium);
    border-radius: 8px;
    padding: 32px 24px;
    text-align: center;
    margin-top: 8px;
}
.teachable-icon {
    font-size: 40px;
    margin-bottom: 12px;
}
.teachable-course-img {
    width: 100%;
    max-width: 320px;
    height: auto;
    border-radius: 6px;
    margin-bottom: 16px;
    object-fit: cover;
}
.course-info {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 24px;
    line-height: 1.5;
}
.course-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

/* --- Teachable Email Notice --- */
.teachable-email-notice {
    margin: 24px 0;
    padding: 16px 18px;
    background: rgba(59, 130, 246, 0.06);
    border: 1px solid rgba(59, 130, 246, 0.15);
    border-radius: 8px;
}
.teachable-email-notice-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}
.teachable-email-notice-icon {
    color: #3B82F6;
    flex-shrink: 0;
}
.teachable-email-notice-label {
    font-size: 13px;
    font-weight: 600;
    color: #3B82F6;
}
.teachable-email-notice-text {
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-primary);
    margin: 0 0 10px 0;
}
.teachable-email-notice-text strong {
    color: var(--text-primary);
    font-weight: 600;
}
.teachable-email-notice-hint {
    font-size: 12px;
    line-height: 1.5;
    color: var(--text-secondary);
    margin: 0;
}

/* --- Welcome --- */
.welcome-header {
    text-align: center;
    margin-bottom: 28px;
}
.welcome-check {
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    background: rgba(52, 211, 153, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--color-success);
}
.welcome-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.welcome-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: var(--surface-raised);
    border: 1px solid var(--border-medium);
    border-radius: 6px;
    text-decoration: none;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    transition: border-color 0.15s, background 0.15s;
}
.welcome-link:hover {
    border-color: var(--brand-red);
    background: var(--surface-card);
}
.welcome-link-icon {
    font-size: 20px;
    flex-shrink: 0;
}

/* --- Payment State --- */
.payment-state {
    padding: 20px 0;
}

/* --- Payment Confirmed Block --- */
.payment-confirmed-block {
    background: rgba(52, 211, 153, 0.06);
    border: 1px solid rgba(52, 211, 153, 0.25);
    border-radius: 8px;
    padding: 40px 24px;
    text-align: center;
    margin-bottom: 28px;
}
.confirmed-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
    background: rgba(52, 211, 153, 0.12);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-success);
}
.confirmed-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--color-success);
    margin-bottom: 8px;
}
.confirmed-plan {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}
.confirmed-detail {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* --- Inline Success --- */
.inline-success {
    text-align: center;
    padding: 20px;
    background: rgba(52, 211, 153, 0.06);
    border: 1px solid rgba(52, 211, 153, 0.15);
    border-radius: 6px;
    margin-top: 16px;
}
.inline-success .check-icon {
    font-size: 28px;
    display: block;
    margin-bottom: 8px;
}
.inline-success p {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 6px;
}

/* --- Validation Feedback --- */
.field-error {
    font-size: 11px;
    color: var(--color-error);
    margin-top: 4px;
    display: none;
}
.form-group.has-error .field-error { display: block; }
.form-group.has-error .form-input { border-color: var(--color-error); }

/* --- Button Variants --- */
.btn-large {
    font-size: 15px;
    padding: 16px;
    min-height: 52px;
}
.btn-secondary {
    width: 100%;
    padding: 12px;
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-medium);
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: border-color 0.15s;
    margin-top: 10px;
}
.btn-secondary:hover { border-color: var(--text-secondary); }

/* ========================================
   Welcome Step — The Threshold Reveal
   Arrival, not celebration. You're IN.
   ======================================== */

/* --- Ambient Warmth Container --- */
.welcome-threshold {
    position: relative;
}
.welcome-threshold::before {
    content: '';
    position: absolute;
    top: -60px;
    left: 50%;
    transform: translateX(-50%);
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, var(--arrival-warmth) 0%, transparent 70%);
    pointer-events: none;
    opacity: 0;
    animation: warmthFadeIn 1.2s ease 0.3s forwards;
}

@keyframes warmthFadeIn {
    to { opacity: 1; }
}

/* --- The Seal (not a checkmark) --- */
.welcome-seal {
    width: 72px;
    height: 72px;
    margin: 0 auto 20px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.welcome-seal svg {
    width: 72px;
    height: 72px;
}

.welcome-seal-ring {
    fill: none;
    stroke: var(--color-success);
    stroke-width: 2;
    stroke-dasharray: 227;
    stroke-dashoffset: 227;
    animation: sealDraw 0.8s ease forwards;
    transform-origin: center;
}

.welcome-seal-check {
    fill: none;
    stroke: var(--color-success);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 50;
    stroke-dashoffset: 50;
    opacity: 0;
    animation: checkDraw 0.4s ease 0.6s forwards;
}

.welcome-seal-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: transparent;
    box-shadow: 0 0 0 0 var(--arrival-glow);
    animation: sealPulse 0.6s ease 1s forwards;
}

@keyframes sealDraw {
    to { stroke-dashoffset: 0; }
}

@keyframes checkDraw {
    0% { opacity: 1; stroke-dashoffset: 50; }
    100% { opacity: 1; stroke-dashoffset: 0; }
}

@keyframes sealPulse {
    0% { box-shadow: 0 0 0 0 var(--arrival-glow); }
    50% { box-shadow: 0 0 30px 10px var(--arrival-glow); }
    100% { box-shadow: 0 0 20px 4px rgba(52, 211, 153, 0.15); }
}

/* --- Welcome Header Animation --- */
.welcome-header--threshold .step-title {
    opacity: 0;
    animation: titleReveal 0.5s ease 0.9s forwards;
}

.welcome-header--threshold .step-subtitle {
    opacity: 0;
    animation: titleReveal 0.5s ease 1.1s forwards;
}

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

/* --- Links Emerge from Center --- */
.welcome-links--threshold {
    position: relative;
}

.welcome-links--threshold .welcome-link {
    opacity: 0;
    transform: scale(0.95);
    animation: linkEmerge 0.4s ease forwards;
}

.welcome-links--threshold .welcome-link:nth-child(1) { animation-delay: 1.2s; }
.welcome-links--threshold .welcome-link:nth-child(2) { animation-delay: 1.35s; }
.welcome-links--threshold .welcome-link:nth-child(3) { animation-delay: 1.5s; }
.welcome-links--threshold .welcome-link:nth-child(4) { animation-delay: 1.65s; }

@keyframes linkEmerge {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(4px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* --- Welcome Link Warm Hover --- */
.welcome-links--threshold .welcome-link {
    border-color: var(--border-subtle);
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.welcome-links--threshold .welcome-link:hover {
    border-color: var(--color-success);
    background: rgba(52, 211, 153, 0.04);
    box-shadow: 0 0 20px -5px rgba(52, 211, 153, 0.15);
}

.welcome-links--threshold .welcome-link-icon {
    transition: transform 0.2s;
}

.welcome-links--threshold .welcome-link:hover .welcome-link-icon {
    transform: scale(1.1);
}

/* --- Welcome Discord CTA (Simplified Final Step) --- */
.welcome-discord-cta {
    text-align: center;
    opacity: 0;
    animation: titleReveal 0.5s ease 1.2s forwards;
}

.welcome-discord-prompt {
    font-size: 15px;
    color: var(--text-secondary);
    margin-top: 32px;
    margin-bottom: 20px;
    letter-spacing: -0.01em;
}

.welcome-discord-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px 32px;
    background: #5865F2;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    font-family: inherit;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 14px rgba(88, 101, 242, 0.35);
}

.welcome-discord-btn:hover {
    background: #4752C4;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(88, 101, 242, 0.45);
}

.welcome-discord-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(88, 101, 242, 0.3);
}

.welcome-discord-btn-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}
