/* ============================================
   DISTORTION.VIP — Subdued Precision
   Instrument Sans · Muted Indigo · Solid Dark
   ============================================ */

:root {
    color-scheme: dark;

    /* All neutrals tinted toward indigo (hue 265) for subconscious cohesion */
    --bg:             oklch(17% 0.018 265);
    --surface:        oklch(21% 0.022 265);
    --surface-raised: oklch(26% 0.027 265);

    /* Borders */
    --border:         oklch(100% 0 0 / 10%);
    --border-strong:  oklch(100% 0 0 / 20%);

    /* Text — indigo-tinted, not neutral gray */
    --text:           oklch(91% 0.012 265);
    --text-secondary: oklch(62% 0.022 265);
    --text-muted:     oklch(45% 0.016 265);

    /* Accent — indigo kept, chroma halved from original */
    --accent:         oklch(63% 0.13 265);
    --accent-hover:   oklch(68% 0.15 265);
    --accent-dim:     oklch(54% 0.11 265);
    --accent-subtle:  oklch(63% 0.13 265 / 9%);
    --accent-glow:    oklch(63% 0.13 265 / 18%);
    --accent-glow-lg: oklch(63% 0.13 265 / 9%);

    /* Status */
    --success:        oklch(71% 0.16 145);
    --danger:         oklch(59% 0.21 22);
    --warning:        oklch(74% 0.14 68);

    /* Shape */
    --radius:         8px;
    --radius-lg:      12px;
    --radius-xl:      18px;

    /* Typography */
    --font: 'Instrument Sans', sans-serif;

    /* Spacing */
    --s1:  4px;
    --s2:  8px;
    --s3:  12px;
    --s4:  16px;
    --s6:  24px;
    --s8:  32px;
    --s12: 48px;
    --s16: 64px;

    /* Legacy aliases — keeps admin.html inline vars intact */
    --card-bg:             var(--surface);
    --card-bg-hover:       var(--surface-raised);
    --glass-border:        var(--border);
    --glass-border-strong: var(--border-strong);
    --glass-shadow:        0 4px 24px oklch(0% 0 0 / 38%);
    --glass-shine:         none;
    --glass-blur:          none;
    --glass-hover:         var(--surface-raised);
}

/* ============================================
   Reset & Base
   ============================================ */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html {
    font-size: 17px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    line-height: 1.5;
    background: var(--bg);
    position: relative;
}

/* Global dot grid background */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: radial-gradient(circle, oklch(63% 0.13 265 / 14%) 1px, transparent 1px);
    background-size: 28px 28px;
    pointer-events: none;
    z-index: 0;
    -webkit-mask-image: radial-gradient(ellipse 90% 90% at 50% 50%, black 5%, transparent 70%);
    mask-image: radial-gradient(ellipse 90% 90% at 50% 50%, black 5%, transparent 70%);
}

a { color: inherit; text-decoration: none; }

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 4px;
}

/* ============================================
   Logo
   ============================================ */
.logo-white  { color: var(--text); }
.logo-orange { color: var(--accent); } /* flat color — no gradient text */

/* ============================================
   Glass helper (kept for class compatibility)
   ============================================ */
.glass {
    background: var(--surface);
    border: 1px solid var(--border);
}

/* ============================================
   Nav
   ============================================ */
.nav {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    display: flex; align-items: center; justify-content: flex-start;
    gap: 40px;
    padding: 0 var(--s8);
    height: 52px;
    background: oklch(13% 0.016 265 / 88%);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.nav-logo {
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    flex-shrink: 0;
    display: flex;
    align-items: center;
}
.nav-logo img { display: block; }

.nav-links { display: flex; align-items: center; gap: 26px; }

.nav-link {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: color 0.15s;
}
.nav-link:hover { color: var(--text); }

/* ── Dropdown ─────────────────────────────── */
.nav-dropdown { position: relative; }

.nav-dropdown-btn {
    display: flex; align-items: center; gap: 5px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: color 0.15s;
    font-family: var(--font);
}
.nav-dropdown-btn:hover { color: var(--text); }
.nav-dropdown-btn svg { opacity: 0.55; transition: transform 0.2s; }
.nav-dropdown.open .nav-dropdown-btn { color: var(--text); }
.nav-dropdown.open .nav-dropdown-btn svg { transform: rotate(180deg); opacity: 0.8; }

.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    min-width: 210px;
    background: oklch(18% 0.02 265);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 6px;
    box-shadow: 0 8px 24px oklch(0% 0 0 / 40%);
    z-index: 200;
}
.nav-dropdown.open .nav-dropdown-menu { display: block; }

.nav-dropdown-item {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 10px;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: background 0.12s, color 0.12s;
}
.nav-dropdown-item:hover { background: var(--surface-raised); color: var(--text); }
.nav-dropdown-item img {
    width: 36px;
    height: 20px;
    object-fit: cover;
    border-radius: 3px;
    flex-shrink: 0;
}

.nav-btn-ghost {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
    padding: 5px 14px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: all 0.15s;
}
.nav-btn-ghost:hover {
    color: var(--text);
    background: var(--surface);
    border-color: var(--border-strong);
}

.nav-btn-outline {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--accent);
    padding: 5px 14px;
    background: var(--accent-subtle);
    border: 1px solid oklch(63% 0.13 265 / 28%);
    border-radius: var(--radius);
    transition: all 0.15s;
}
.nav-btn-outline:hover {
    background: oklch(63% 0.13 265 / 13%);
    border-color: oklch(63% 0.13 265 / 45%);
    box-shadow: 0 0 16px var(--accent-glow);
}

/* ============================================
   Hero
   ============================================ */
.hero {
    position: relative;
    display: flex;
    align-items: center;
    flex: 1;
    min-height: 82vh;
    padding: 130px max(var(--s8), calc((100vw - 980px) / 2)) 80px;
    overflow: hidden;
}

/* Dot grid — geometric, precise, technical */
.hero-grid {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, oklch(63% 0.13 265 / 18%) 1px, transparent 1px);
    background-size: 28px 28px;
    -webkit-mask-image: radial-gradient(ellipse 85% 95% at 48% 45%, black 10%, transparent 68%);
    mask-image: radial-gradient(ellipse 85% 95% at 48% 45%, black 10%, transparent 68%);
    pointer-events: none;
}

.hero-inner {
    position: relative; z-index: 1;
    max-width: 640px;
    animation: fade-up 1.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
}

@keyframes fade-up {
    from { opacity: 0; transform: translateY(52px) scale(0.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.hero-eyebrow {
    display: flex;
    align-items: center;
    gap: var(--s3);
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: var(--s6);
}
.hero-eyebrow::before {
    content: '';
    width: 20px;
    height: 1px;
    background: currentColor;
    flex-shrink: 0;
}

.hero-title {
    font-size: clamp(3rem, 8vw, 5.5rem);
    font-weight: 700;
    letter-spacing: -0.045em;
    line-height: 0.93;
    margin-bottom: var(--s6);
    color: var(--text);
}

.title-line { display: block; }

.hero-sub {
    font-size: 1rem;
    font-weight: 400;
    color: var(--text-secondary);
    margin-bottom: var(--s8);
    max-width: 420px;
    line-height: 1.7;
}

.hero-buttons {
    display: flex;
    gap: var(--s3);
}

/* ============================================
   Buttons
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--s2) var(--s4);
    font-family: var(--font);
    font-size: 0.84rem;
    font-weight: 600;
    border-radius: var(--radius);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.btn-primary {
    background: var(--accent);
    color: oklch(98% 0.005 265);
    border-color: var(--accent-dim);
}
.btn-primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent);
    box-shadow: 0 2px 16px var(--accent-glow);
    transform: translateY(-1px);
}
.btn-primary:active  { transform: translateY(0); box-shadow: none; }
.btn-primary:disabled { opacity: 0.35; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border-color: var(--border);
}
.btn-ghost:hover {
    color: var(--text);
    background: var(--surface);
    border-color: var(--border-strong);
}
.btn-ghost:disabled { opacity: 0.35; cursor: not-allowed; }

.btn-danger {
    background: oklch(59% 0.21 22 / 7%);
    color: var(--danger);
    border-color: oklch(59% 0.21 22 / 22%);
}
.btn-danger:hover {
    background: oklch(59% 0.21 22 / 12%);
    border-color: oklch(59% 0.21 22 / 40%);
}

.btn-full { width: 100%; }
.btn-lg   { padding: var(--s2) var(--s6); font-size: 0.88rem; }

/* ============================================
   Footer
   ============================================ */
.footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 960px;
    margin: 0 auto;
    width: 100%;
    padding: var(--s6) var(--s8);
    border-top: 1px solid var(--border);
}
.footer-logo { font-size: 0.85rem; font-weight: 700; letter-spacing: -0.01em; }
.footer-copy  { font-size: 0.7rem; color: var(--text-muted); letter-spacing: 0.04em; }

/* ============================================
   Auth Pages
   ============================================ */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: var(--s12) var(--s6);
}

.auth-card {
    width: 100%;
    max-width: 360px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 36px 32px;
    box-shadow: 0 8px 32px oklch(0% 0 0 / 40%);
    animation: fade-up 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
    position: relative;
    overflow: hidden;
}

/* Subtle accent hairline — not a neon stripe */
.auth-card::before {
    content: '';
    position: absolute;
    top: 0; left: 15%; right: 15%;
    height: 1px;
    background: linear-gradient(90deg, transparent, oklch(63% 0.13 265 / 45%), transparent);
}

.auth-header {
    margin-bottom: var(--s8);
    text-align: center;
}
.auth-header h1 {
    font-size: 1.375rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.15;
    margin-bottom: var(--s1);
}
.auth-header p {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.form-group { margin-bottom: var(--s4); }

.form-label {
    display: block;
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: var(--s2);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.form-input {
    width: 100%;
    padding: 10px 14px;
    font-family: var(--font);
    font-size: 0.84rem;
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.form-input::placeholder { color: var(--text-muted); }
.form-input:hover  { border-color: var(--border-strong); }
.form-input:focus  {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px oklch(63% 0.13 265 / 12%);
}

.auth-footer {
    margin-top: var(--s6);
    text-align: center;
    font-size: 0.78rem;
    color: var(--text-secondary);
}
.auth-footer a { color: var(--accent); font-weight: 500; }
.auth-footer a:hover { color: var(--accent-hover); }

.forgot-link {
    font-size: 0.7rem;
    color: var(--text-muted);
    transition: color 0.15s;
}
.forgot-link:hover { color: var(--accent); }

/* ============================================
   Alerts
   ============================================ */
.alert {
    padding: 10px var(--s3);
    border-radius: var(--radius);
    font-size: 0.78rem;
    font-weight: 500;
    margin-bottom: var(--s4);
    display: none;
    line-height: 1.5;
    border-left: 2px solid currentColor;
}
.alert.show { display: block; }

.alert-error   { color: var(--danger);  background: oklch(59% 0.21 22  / 6%); }
.alert-success { color: var(--success); background: oklch(71% 0.16 145 / 6%); }
.alert-warning { color: var(--warning); background: oklch(74% 0.14 68  / 6%); }

/* ============================================
   Dashboard
   ============================================ */
.dashboard {
    max-width: 700px;
    margin: 0 auto;
    padding: 96px var(--s6) var(--s16);
    width: 100%;
}

/* Staggered section entry */
.dash-section {
    animation: fade-up 1s cubic-bezier(0.16, 1, 0.3, 1) both;
    animation-delay: var(--anim-delay, 0ms);
}

.dash-signout-btn { font-size: 0.75rem; padding: 4px 12px; }
.hwid-row-right { display: flex; align-items: center; gap: var(--s2); }
.hwid-reset-btn { font-size: 0.7rem; padding: 5px 10px; white-space: nowrap; flex-shrink: 0; }

/* Stat grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--s3);
    margin-bottom: var(--s3);
}

.dash-card {
    background: var(--surface-raised);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--s4) var(--s6);
}
.dash-card-label {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: var(--s2);
}
.dash-card-value {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}
.dash-card-value.active  { color: var(--success); }
.dash-card-value.expired { color: var(--danger); }
.dash-card-value.none    { color: var(--text-muted); }

/* Section cards — generous gap creates breathing rhythm between blocks */
.account-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--s6);
    margin-bottom: var(--s6);
    box-shadow: 0 2px 16px oklch(0% 0 0 / 22%);
    position: relative;
    overflow: hidden;
}

/* Download card: primary action — more presence than info cards */
.download-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--s8);
    margin-bottom: 0;
    box-shadow: 0 4px 32px oklch(0% 0 0 / 36%);
    position: relative;
    overflow: hidden;
}

/* Subtle accent hairline — purposeful, not decorative */
.download-card::before {
    content: '';
    position: absolute;
    top: 0; left: 20%; right: 20%;
    height: 1px;
    background: linear-gradient(90deg, transparent, oklch(63% 0.13 265 / 40%), transparent);
}

.download-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--s3);
}
.download-card-header h2,
.account-card h2 {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}
.account-card h2 { margin-bottom: var(--s4); }

.download-status {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    background: oklch(71% 0.16 145 / 8%);
    color: var(--success);
    border: 1px solid oklch(71% 0.16 145 / 22%);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.download-status.offline {
    background: oklch(59% 0.21 22 / 8%);
    color: var(--danger);
    border-color: oklch(59% 0.21 22 / 22%);
}

.download-desc {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-bottom: var(--s6);
    line-height: 1.6;
}

/* Progress */
.download-progress { display: none; margin-bottom: var(--s4); }
.download-progress.show { display: block; }

.progress-bar-track {
    width: 100%;
    height: 2px;
    background: var(--border);
    border-radius: 1px;
    overflow: hidden;
}
.progress-bar-fill {
    height: 100%;
    width: 40%;
    background: var(--accent);
    border-radius: 1px;
    animation: progress-slide 1.4s cubic-bezier(0.4, 0, 0.6, 1) infinite;
    box-shadow: 0 0 8px var(--accent-glow);
}
@keyframes progress-slide {
    0%   { transform: translateX(-100%); }
    50%  { transform: translateX(150%); }
    100% { transform: translateX(150%); }
}
.download-progress-text {
    font-size: 0.72rem;
    color: var(--text-secondary);
    margin-top: var(--s2);
}

/* ── User Info redesign ── */

.user-profile-header {
    display: flex;
    align-items: center;
    gap: var(--s4);
    padding-bottom: var(--s6);
    margin-bottom: var(--s4);
    border-bottom: 1px solid var(--border);
}

.user-avatar {
    width: 52px;
    height: 52px;
    flex-shrink: 0;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, oklch(63% 0.13 265 / 22%), oklch(63% 0.13 265 / 8%));
    border: 1px solid oklch(63% 0.13 265 / 38%);
    box-shadow: 0 0 0 3px oklch(63% 0.13 265 / 9%), 0 4px 16px oklch(0% 0 0 / 28%);
    color: var(--accent);
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
    user-select: none;
}

.user-profile-meta {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
    flex: 1;
}

.user-profile-name {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--text);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-profile-since {
    font-size: 0.72rem;
    color: var(--text-muted);
    line-height: 1;
}

.user-info-rows {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.user-info-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s4);
    padding: 11px var(--s4);
    background: transparent;
    transition: background 0.12s;
}
.user-info-row:not(:last-child) { border-bottom: 1px solid var(--border); }
.user-info-row:hover { background: oklch(100% 0 0 / 2.5%); }

.user-info-label {
    font-size: 0.63rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    flex-shrink: 0;
    min-width: 68px;
}

.user-info-value {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: right;
    max-width: 62%;
}

.user-info-row-hwid { align-items: center; }

.user-info-hwid-right {
    display: flex;
    align-items: center;
    gap: var(--s2);
    min-width: 0;
    max-width: 65%;
}

.hwid-value {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.67rem;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1;
    flex: 1;
    min-width: 0;
}

/* Section header */
.sub-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--s4);
    padding-bottom: var(--s4);
    border-bottom: 1px solid var(--border);
}
.sub-section-header h2 {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}
.sub-upgrade-btn { font-size: 0.75rem; padding: 6px 16px; }
.sub-manage-link {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
    transition: color 0.15s;
}
.sub-manage-link:hover { color: var(--accent); }
.sub-grid { margin-bottom: 0 !important; }

/* Upgrade banner */
.upgrade-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s4);
    margin-top: var(--s4);
    padding: var(--s4);
    background: oklch(63% 0.13 265 / 7%);
    border: 1px solid oklch(63% 0.13 265 / 18%);
    border-radius: var(--radius-lg);
}
.upgrade-banner-text { display: flex; flex-direction: column; gap: 3px; }
.upgrade-banner-title { font-size: 0.84rem; font-weight: 600; color: var(--text); }
.upgrade-banner-sub   { font-size: 0.72rem; color: var(--text-secondary); }

/* Logout link */
.user-logout-row {
    margin-top: var(--s4);
    display: flex;
    justify-content: flex-end;
}
.user-logout-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    transition: color 0.15s;
    letter-spacing: 0.01em;
}
.user-logout-link:hover { color: var(--danger); }

/* ============================================
   Pricing
   ============================================ */
.pricing-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--s6);
    margin-bottom: var(--s3);
    box-shadow: 0 4px 24px oklch(0% 0 0 / 30%);
    position: relative;
    overflow: hidden;
}
.pricing-header { margin-bottom: var(--s6); }
.pricing-header h2 {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: var(--s1);
}
.pricing-header p { font-size: 0.78rem; color: var(--text-secondary); }

.pricing-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: var(--s3);
    margin-bottom: var(--s3);
}

.pricing-plan {
    background: var(--surface-raised);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--s4);
    display: flex;
    flex-direction: column;
    gap: var(--s3);
    transition: border-color 0.2s;
}
.pricing-plan:hover { border-color: var(--border-strong); }
.pricing-plan .btn  { margin-top: auto; }

.pricing-plan-featured {
    border-color: oklch(63% 0.13 265 / 45%);
    background: oklch(63% 0.13 265 / 8%);
    box-shadow: 0 0 40px oklch(63% 0.13 265 / 14%), inset 0 1px 0 oklch(63% 0.13 265 / 30%);
}
.pricing-plan-featured:hover {
    border-color: oklch(63% 0.13 265 / 65%);
    box-shadow: 0 0 52px oklch(63% 0.13 265 / 20%), inset 0 1px 0 oklch(63% 0.13 265 / 40%);
}
.pricing-plan-featured .pricing-plan-price { color: oklch(92% 0.02 265); }

.pricing-plan-badge {
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--accent);
}
.pricing-plan-name {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.pricing-plan-price {
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: -0.05em;
    line-height: 1;
    color: var(--text);
}
.pricing-plan-price span {
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--text-secondary);
    letter-spacing: 0;
    font-variant-numeric: tabular-nums;
}
.pricing-plan-save {
    font-size: 0.68rem;
    color: var(--success);
    font-weight: 600;
    margin-top: calc(var(--s1) * -1);
}

/* ============================================
   Spinner
   ============================================ */
.spinner {
    display: inline-block;
    width: 12px; height: 12px;
    border: 1.5px solid oklch(100% 0 0 / 18%);
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.5s linear infinite;
    margin-right: var(--s2);
    vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

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

/* Touch devices — proper touch targets regardless of screen size */
@media (hover: none) and (pointer: coarse) {
    .btn { min-height: 44px; }
    .nav-btn-ghost,
    .nav-btn-outline { min-height: 38px; padding-top: 8px; padding-bottom: 8px; }
    .form-input { padding: 13px 14px; }
}

/* Large desktop (1400px+) — give the hero more room to breathe */
@media (min-width: 1400px) {
    .hero-inner { max-width: 820px; }
    .hero-title  { font-size: clamp(5.5rem, 7vw, 7rem); }
}

/* Tablet (641px – 900px) — pricing 2-col, slightly tighter spacing */
@media (min-width: 641px) and (max-width: 900px) {
    .pricing-grid {
        grid-template-columns: 1fr 1fr;
    }
    /* Featured card spans full width on tablet for emphasis */
    .pricing-plan-featured {
        grid-column: 1 / -1;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: var(--s8);
    }
    .pricing-plan-featured .btn { margin-top: 0; min-width: 160px; }
}

/* ── Hamburger button (hidden on desktop) ── */
.nav-hamburger {
    display: none;
    background: none;
    border: none;
    color: var(--text);
    cursor: pointer;
    padding: 6px;
    margin-left: auto;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
}
.nav-hamburger svg { display: block; }

/* ── Mobile overlay backdrop ── */
.nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: oklch(0% 0 0 / 50%);
    z-index: 150;
}
.nav-overlay.open { display: block; }

/* Mobile (≤640px) */
@media (max-width: 640px) {
    /* Nav */
    .nav { padding: 0 var(--s4); }
    .nav-hamburger { display: flex; }

    /* Slide-down drawer */
    .nav-links {
        display: none;
        position: fixed;
        top: 52px;
        left: 0;
        right: 0;
        z-index: 200;
        flex-direction: column;
        gap: 0;
        background: oklch(15% 0.018 265);
        border-bottom: 1px solid var(--border);
        padding: 8px 0;
        box-shadow: 0 8px 32px oklch(0% 0 0 / 50%);
        max-height: calc(100vh - 52px);
        overflow-y: auto;
    }
    .nav-links.open { display: flex; }

    .nav-link,
    .nav-btn-ghost,
    .nav-btn-outline {
        padding: 14px var(--s6);
        font-size: 0.95rem;
        width: 100%;
        min-height: 44px;
        display: flex;
        align-items: center;
        border: none;
        border-radius: 0;
        background: none;
    }
    .nav-btn-ghost,
    .nav-btn-outline { justify-content: flex-start; }

    /* Dropdown in mobile menu */
    .nav-dropdown { width: 100%; }
    .nav-dropdown-btn {
        padding: 14px var(--s6);
        font-size: 0.95rem;
        width: 100%;
        min-height: 44px;
        justify-content: flex-start;
    }
    .nav-dropdown-menu {
        position: static;
        box-shadow: none;
        border: none;
        background: oklch(12% 0.016 265);
        border-radius: 0;
        padding: 4px 0;
        min-width: 0;
    }
    .nav-dropdown-item {
        padding: 12px var(--s8);
        min-height: 44px;
    }

    /* Hero */
    .hero { padding: 110px var(--s4) var(--s8); }
    .hero-eyebrow { font-size: 0.6rem; }
    .hero-title { font-size: clamp(2.2rem, 10vw, 3rem); }
    .hero-sub { font-size: 0.9rem; max-width: 100%; }
    .hero-buttons { flex-direction: row; flex-wrap: wrap; gap: var(--s2); }
    .hero-buttons .btn-lg { min-height: 44px; font-size: 0.82rem; padding: var(--s2) var(--s4); }

    /* Dashboard */
    .dashboard { padding: 80px var(--s3) var(--s12); }
    .dashboard-grid { grid-template-columns: 1fr; gap: var(--s2); }
    .account-card,
    .download-card { padding: var(--s4); }

    /* User info section */
    .user-profile-header { padding-bottom: var(--s4); }
    .user-avatar { width: 44px; height: 44px; font-size: 1rem; }
    .user-profile-name { font-size: 0.95rem; }
    .user-info-value { max-width: 55%; }
    .user-info-row { padding: 10px var(--s3); }
    .hwid-reset-btn { min-height: 34px; padding: 5px 10px; }

    /* Pricing */
    .pricing-grid { grid-template-columns: 1fr; }
    .pricing-plan-price { font-size: 1.9rem; }

    /* Auth */
    .auth-page { padding: var(--s12) var(--s4); }
    .auth-card  { padding: 28px 20px; border-radius: var(--radius-lg); }
    .form-input { padding: 13px 14px; min-height: 48px; font-size: 0.9rem; }
    .forgot-link { font-size: 0.75rem; }

    /* Footer */
    .footer { flex-direction: column; gap: var(--s2); text-align: center; padding: var(--s4); }

    /* Upgrade banner */
    .upgrade-banner { flex-direction: column; align-items: flex-start; }
    .sub-upgrade-btn { width: 100%; }

    /* Dot grid — lighter on mobile for performance */
    body::before { opacity: 0.5; }
}

/* ============================================
   View Transitions — Cinematic Page Navigation
   ============================================ */

/* Opt all pages into cross-document view transitions */
@view-transition {
    navigation: auto;
}

/* Nav logo persists as a named element — morphs between pages */
.nav-logo {
    view-transition-name: site-logo;
}

/* Outgoing page: lift and fade */
@keyframes vt-out {
    to {
        opacity: 0;
        transform: translateY(-10px) scale(0.985);
    }
}

/* Incoming page: rise from below */
@keyframes vt-in {
    from {
        opacity: 0;
        transform: translateY(22px) scale(0.985);
    }
}

/* Root content transitions */
::view-transition-old(root) {
    animation: 200ms cubic-bezier(0.4, 0, 1, 1) both vt-out;
}
::view-transition-new(root) {
    animation: 420ms cubic-bezier(0.16, 1, 0.3, 1) 80ms both vt-in;
}

/* Logo: custom morph — smooth position shift, no fade */
::view-transition-old(site-logo),
::view-transition-new(site-logo) {
    animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
    animation-duration: 380ms;
}

/* ============================================
   Utility Classes (CSP-safe replacements for inline styles)
   ============================================ */
.hidden { display: none; }
.mb-0 { margin-bottom: 0; }
.mb-4 { margin-bottom: var(--s4); }
.mb-8 { margin-bottom: var(--s8); }
.mt-8 { margin-top: var(--s8); }
.ml-1 { margin-left: 4px; }
.border-b-none { border-bottom: none; }
.text-primary { color: var(--text); }
.text-accent { color: var(--accent); }
.text-muted-color { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.fw-600 { font-weight: 600; }

/* Form layout helpers */
.form-group-center { display: flex; justify-content: center; }
.password-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 7px;
    flex-wrap: wrap;
    gap: 4px;
}

/* Purchase page layout */
.purchase-hero-layout {
    min-height: 100vh;
    align-items: flex-start;
    padding-top: 120px;
}
.purchase-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 700px;
    margin: 0 auto;
    padding: 0 var(--s6);
}
.purchase-title {
    font-size: clamp(1.6rem, 4vw, 2.4rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--text);
    line-height: 1.1;
    margin-bottom: var(--s2);
}
.purchase-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
}
.subscribe-error-spaced {
    margin-top: var(--s4);
    margin-bottom: 0;
}

/* BO3-specific */
.bo3-grid {
    grid-template-columns: 1fr;
    max-width: 400px;
    margin: 0 auto;
}
.plan-badge-free {
    background: oklch(71% 0.16 145 / 12%);
    border-color: oklch(71% 0.16 145 / 30%);
    color: var(--success);
}
.btn-success { background: var(--success); }
.subscribe-success-text {
    text-align: center;
    margin-top: 16px;
    font-size: 0.8rem;
    color: var(--success);
}

/* Pricing loading */
.pricing-loading-text {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.82rem;
    padding: 20px;
}

/* Dashboard helpers */
.hwid-alerts-wrap { padding: var(--s2) var(--s6) var(--s4); }

/* Admin helpers */
.modal-divider {
    border: none;
    border-top: 1px solid var(--glass-border);
    margin: var(--s4) 0;
}
.modal-current-sub-text {
    font-size: 0.82rem;
    color: var(--text-secondary);
    padding: 8px 0;
}
.optional-label {
    color: var(--text-muted);
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
}
.anim-delay-0   { --anim-delay: 0ms; }
.anim-delay-60  { --anim-delay: 60ms; }
.anim-delay-120 { --anim-delay: 120ms; }
.anim-delay-180 { --anim-delay: 180ms; }
.anim-delay-240 { --anim-delay: 240ms; }

/* Admin JS-generated element styles */
.admin-user-name { font-weight: 600; font-size: 0.8rem; }
.admin-user-email { font-size: 0.68rem; color: var(--text-muted); margin-top: 1px; }
.admin-hwid-text { font-family: monospace; font-size: 0.65rem; color: var(--text-secondary); }
.admin-role-user { color: var(--text-muted); font-size: 0.72rem; }
.admin-badge-gap { margin-right: 4px; margin-bottom: 2px; }
.admin-sub-item { margin-bottom: 6px; }
.admin-sub-status-active { color: var(--success); font-weight: 600; text-transform: uppercase; font-size: 0.72rem; }
.admin-sub-status-expired { color: var(--danger); font-weight: 600; text-transform: uppercase; font-size: 0.72rem; }
.btn-opacity-dim { opacity: 0.6; }

/* ============================================
   Reduced Motion
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.1ms !important;
    }
    .hero-inner,
    .auth-card,
    .dash-section {
        opacity: 1;
        transform: none;
    }
    /* Disable view transitions for reduced motion users */
    ::view-transition-old(root),
    ::view-transition-new(root),
    ::view-transition-old(site-logo),
    ::view-transition-new(site-logo) {
        animation: none !important;
    }
}
