/* ============================================================
   ASecurity Academy — theme  (white · purple · black)
   Space Grotesk for display, Inter for reading, JetBrains
   Mono for technical labels. Purple is the single accent,
   black is reserved for chrome (header, footer, terminal).
   ============================================================ */

:root {
    --bg:          #f6f4fc;
    --bg-soft:     #efeafb;
    --surface:     #ffffff;
    --surface-2:   #f4f1fb;
    --surface-3:   #ebe5f7;
    --border:      #e7e1f2;
    --border-lit:  #d7cdec;

    --text:        #17131f;
    --muted:       #635d73;
    --faint:       #948da6;

    --brand:       #7c3aed;   /* purple — the accent */
    --brand-dim:   #6d28d9;
    --brand-2:     #a06bff;
    --brand-soft:  #f2ecff;   /* light purple tint */
    --brand-ink:   #ffffff;

    --accent:      #7c3aed;   /* alias: links, progress, focus */
    --accent-dim:  #a06bff;
    --accent-ink:  #ffffff;

    --ink:         #141019;   /* black chrome */
    --ink-2:       #1c1726;
    --ink-soft:    rgba(255,255,255,.72);

    --gold:        #b26a00;   /* reward text on white */
    --success:     #15a34a;
    --danger:      #dc2626;

    --diff-easy:   #15a34a;
    --diff-medium: #d97706;
    --diff-hard:   #dc2626;
    --diff-insane: #7c3aed;

    --shadow-sm:   0 2px 8px -3px rgba(23,19,31,.12);
    --shadow:      0 14px 34px -18px rgba(74,35,140,.30);
    --shadow-lg:   0 26px 60px -24px rgba(74,35,140,.38);

    --radius:      16px;
    --radius-sm:   10px;
    --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
    --sans: 'Inter', system-ui, -apple-system, sans-serif;
    --display: 'Space Grotesk', 'Inter', system-ui, sans-serif;
    --maxw: 1160px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--sans);
    color: var(--text);
    background:
        radial-gradient(760px 420px at 88% -8%, rgba(124,58,237,.14), transparent 60%),
        radial-gradient(680px 420px at 4% 2%, rgba(160,107,255,.10), transparent 55%),
        var(--bg);
    background-attachment: fixed;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }

h1, h2, h3, h4 { font-family: var(--display); line-height: 1.15; margin: 0 0 .5em; font-weight: 600; letter-spacing: -.01em; color: var(--text); }
h1 { font-size: clamp(2rem, 4.4vw, 3rem); font-weight: 700; }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }

.ti { line-height: 1; vertical-align: -.125em; }

code {
    font-family: var(--mono);
    background: var(--brand-soft);
    padding: .12em .42em;
    border-radius: 6px;
    font-size: .9em;
    color: var(--brand-dim);
}

/* ---- Header / nav ---------------------------------------- */
.site-header {
    position: sticky; top: 0; z-index: 50;
    background: var(--ink);
    border-bottom: 1px solid rgba(255,255,255,.08);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; }

.brand { display: flex; align-items: center; gap: 11px; font-family: var(--display); font-weight: 700; }
.brand:hover { text-decoration: none; }
.brand-mark {
    width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center;
    background: linear-gradient(150deg, var(--brand-2), var(--brand)); color: #fff; font-size: 1.25rem;
    box-shadow: 0 6px 16px -4px rgba(124,58,237,.6);
}
.brand-name { color: #fff; font-size: 1.16rem; letter-spacing: -.02em; }
.brand-accent { color: var(--brand-2); }

.site-nav { display: flex; align-items: center; gap: 6px; }
.site-nav > a { color: rgba(255,255,255,.74); font-weight: 500; font-size: .93rem; padding: 8px 12px; border-radius: 9px; display: inline-flex; align-items: center; gap: 7px; transition: .15s; }
.site-nav > a .ti { font-size: 1.05rem; color: rgba(255,255,255,.5); }
.site-nav > a:hover { color: #fff; background: rgba(255,255,255,.08); text-decoration: none; }
.site-nav > a:hover .ti { color: var(--brand-2); }
.nav-admin { color: #ffd7a1 !important; }
.nav-team  { color: #c9b3ff !important; }
/* ---- User dropdown menu ---- */
.nav-menu { position: relative; display: inline-flex; }
.nav-user {
    display: inline-flex; align-items: center; gap: 8px; color: #fff; font-weight: 600; cursor: pointer;
    padding: 5px 10px 5px 6px; border-radius: 999px; background: rgba(255,255,255,.05);
    border: 1px solid rgba(255,255,255,.10); font-family: var(--sans); font-size: .9rem; transition: .15s;
}
.nav-user:hover { background: rgba(255,255,255,.10); border-color: rgba(255,255,255,.2); }
.nav-user .nav-avatar { width: 26px; height: 26px; margin-right: 0; border: 1px solid rgba(255,255,255,.18); }
.nav-caret { font-size: 1rem; color: rgba(255,255,255,.55); transition: transform .18s; }
.nav-menu.open .nav-caret { transform: rotate(180deg); }
.nav-points {
    background: rgba(124,58,237,.24); border: 1px solid rgba(160,107,255,.4);
    color: #e4d7ff; padding: 3px 9px; border-radius: 999px; font-size: .78rem; font-family: var(--mono);
    display: inline-flex; align-items: center; gap: 4px;
}
.nav-dropdown {
    position: absolute; top: calc(100% + 10px); right: 0; min-width: 232px; z-index: 60;
    background: var(--surface); border: 1px solid var(--border-lit); border-radius: 14px;
    box-shadow: 0 18px 44px -12px rgba(20,16,25,.35); padding: 8px;
    opacity: 0; visibility: hidden; transform: translateY(-6px); transition: opacity .16s, transform .16s, visibility .16s;
}
.nav-menu.open .nav-dropdown { opacity: 1; visibility: visible; transform: translateY(0); }
.nav-dropdown-head { display: flex; align-items: center; gap: 10px; padding: 8px 10px 10px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.nav-dropdown-head .nav-avatar { width: 38px; height: 38px; margin: 0; border: 1px solid var(--border-lit); }
.nav-dropdown-head b { display: block; color: var(--text); font-size: .95rem; }
.nav-dropdown-head span { display: block; color: var(--muted); font-size: .78rem; font-family: var(--mono); margin-top: 1px; }
.nav-dropdown > a {
    display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 9px;
    color: var(--text); font-size: .9rem; font-weight: 500; transition: background .12s;
}
.nav-dropdown > a .ti { font-size: 1.05rem; color: var(--muted); width: 18px; text-align: center; }
.nav-dropdown > a:hover { background: var(--surface-2); text-decoration: none; color: var(--brand); }
.nav-dropdown > a:hover .ti { color: var(--brand); }
.nav-dropdown-sep { height: 1px; background: var(--border); margin: 6px 4px; }
.nav-dd-admin:hover { color: var(--brand-dim) !important; }
.nav-dd-logout { color: var(--danger) !important; }
.nav-dd-logout .ti { color: var(--danger) !important; }
.nav-dd-logout:hover { background: rgba(220,38,38,.08) !important; }
.site-header .btn-ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.24); }
.site-header .btn-ghost:hover { background: rgba(255,255,255,.06); border-color: var(--brand-2); color: var(--brand-2); }

.nav-toggle { display: none; background: none; border: 0; cursor: pointer; flex-direction: column; gap: 5px; padding: 8px; }
.nav-toggle span { width: 22px; height: 2px; background: #fff; border-radius: 2px; }

/* ---- Buttons --------------------------------------------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    font-family: var(--sans); font-weight: 600; font-size: .95rem;
    padding: 11px 20px; border-radius: var(--radius-sm);
    border: 1px solid transparent; cursor: pointer; transition: .16s ease;
    text-decoration: none;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn .ti { font-size: 1.15rem; }
.btn-sm { padding: 7px 14px; font-size: .875rem; }
.btn-lg { padding: 14px 26px; font-size: 1.05rem; }
.btn-primary { background: var(--brand); color: var(--brand-ink); box-shadow: 0 10px 24px -8px rgba(124,58,237,.55); }
.btn-primary:hover { background: var(--brand-dim); box-shadow: 0 12px 28px -8px rgba(124,58,237,.65); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border-lit); }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }
.btn-block { width: 100%; }

/* ---- Flash / alerts -------------------------------------- */
.page { flex: 1; padding: 32px 22px 72px; }
.flash {
    padding: 13px 16px; border-radius: var(--radius-sm); margin-bottom: 22px;
    border: 1px solid; font-size: .95rem; display: flex; align-items: center; gap: 9px;
}
.flash .ti { font-size: 1.15rem; }
.flash-success { background: #e9faf0; border-color: #a7e9c2; color: #157a3c; }
.flash-error   { background: #fdecec; border-color: #f3bcbc; color: #b91c1c; }
.flash-info    { background: var(--brand-soft); border-color: #d8c7ff; color: var(--brand-dim); }

/* ---- Hero ------------------------------------------------- */
.hero { padding: 58px 0 34px; display: grid; grid-template-columns: 1.05fr .95fr; gap: 50px; align-items: center; }
.hero-eyebrow { font-family: var(--mono); color: var(--brand); font-size: .82rem; letter-spacing: .14em; text-transform: uppercase; margin-bottom: 18px; display: inline-flex; align-items: center; gap: 8px; }
.hero h1 { letter-spacing: -.025em; }
.hero h1 .hl { color: var(--brand); }
.hero p.lead { color: var(--muted); font-size: 1.13rem; max-width: 46ch; margin: 18px 0 30px; }
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 34px; margin-top: 42px; }
.hero-stats .stat b { font-family: var(--display); font-size: 1.7rem; color: var(--text); display: block; }
.hero-stats .stat span { color: var(--faint); font-size: .82rem; }

/* terminal mock (dark panel on light page) */
.terminal {
    background: var(--ink-2); border: 1px solid rgba(255,255,255,.08); border-radius: var(--radius);
    overflow: hidden; box-shadow: var(--shadow-lg); font-family: var(--mono); font-size: .88rem;
}
.terminal-bar { display: flex; align-items: center; gap: 7px; padding: 12px 15px; background: #120e1a; border-bottom: 1px solid rgba(255,255,255,.06); }
.terminal-bar i { width: 11px; height: 11px; border-radius: 50%; display: inline-block; }
.terminal-bar i:nth-child(1){ background:#ff5f57 } .terminal-bar i:nth-child(2){ background:#febc2e } .terminal-bar i:nth-child(3){ background:#28c840 }
.terminal-bar span { color: rgba(255,255,255,.4); font-size: .78rem; margin-left: 8px; }
.terminal-body { padding: 18px; line-height: 1.85; color: #d7d0e6; }
.terminal-body .c-prompt { color: var(--brand-2); }
.terminal-body .c-cmd { color: #fff; }
.terminal-body .c-out { color: rgba(255,255,255,.55); }
.terminal-body .c-flag { color: #7ee2a8; }
.terminal-body .cursor::after { content:'▋'; color: var(--brand-2); animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ---- Section headings ------------------------------------ */
section { margin-top: 52px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; margin: 8px 0 22px; gap: 16px; }
.section-head h2 { margin: 0; }
.section-head .eyebrow, .eyebrow { font-family: var(--mono); color: var(--brand); font-size: .76rem; letter-spacing: .12em; text-transform: uppercase; }
.section-sub { color: var(--muted); margin: 6px 0 0; font-size: .96rem; }
.accent { color: var(--brand); }

/* ---- Cards / room grid ----------------------------------- */
.grid { display: grid; gap: 20px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

.card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 22px; transition: .18s ease; box-shadow: var(--shadow-sm);
}
.room-card { display: flex; flex-direction: column; position: relative; }
.room-card:hover { border-color: var(--brand-2); transform: translateY(-3px); box-shadow: var(--shadow); }
.room-card .cat { font-family: var(--mono); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--brand); font-weight: 500; }
.room-card h3 { margin: 9px 0 6px; font-size: 1.2rem; }
.room-card h3 a { color: var(--text); }
.room-card h3 a:hover { color: var(--brand); text-decoration: none; }
.room-card p { color: var(--muted); font-size: .93rem; margin: 0 0 16px; flex: 1; }
.room-card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.room-meta { display: flex; align-items: center; gap: 10px; justify-content: space-between; margin-top: auto; }
.room-card.locked { opacity: .96; }

.badge {
    font-family: var(--mono); font-size: .72rem; font-weight: 500;
    padding: 3px 11px; border-radius: 999px; border: 1px solid; display: inline-flex; align-items: center; gap: 5px;
}
.diff-easy   { color: var(--diff-easy);   border-color: #b7e6c8; background: #eafaf0; }
.diff-medium { color: var(--diff-medium); border-color: #f2d5a8; background: #fdf3e6; }
.diff-hard   { color: var(--diff-hard);   border-color: #f3bcbc; background: #fdecec; }
.diff-insane { color: var(--diff-insane); border-color: #d8c7ff; background: var(--brand-soft); }

/* progress bar */
.progress { height: 7px; background: var(--surface-3); border-radius: 999px; overflow: hidden; margin-top: 14px; }
.progress > i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--brand-2)); border-radius: 999px; transition: width .4s ease; }
.progress.lg { height: 10px; }
.progress-label { font-family: var(--mono); font-size: .74rem; color: var(--faint); margin-top: 6px; }

/* ---- Access badges --------------------------------------- */
.access-badge { display: inline-flex; align-items: center; gap: 4px; font-family: var(--mono); font-size: .68rem; letter-spacing: .04em; text-transform: uppercase; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--border-lit); white-space: nowrap; }
.access-free      { color: var(--faint); }
.access-pro       { color: var(--brand); border-color: #d8c7ff; background: var(--brand-soft); }
.access-corporate { color: var(--gold);  border-color: #f2d5a8; background: #fdf3e6; }

/* ---- Auth forms ------------------------------------------ */
.auth-wrap { max-width: 430px; margin: 30px auto; }
.auth-wrap .card { padding: 32px; }
.auth-wrap h1 { font-size: 1.7rem; }
.auth-sub { color: var(--muted); margin: -2px 0 24px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: .85rem; color: var(--muted); margin-bottom: 6px; font-weight: 500; }
.input, textarea.input, select.input {
    width: 100%; background: var(--surface); border: 1px solid var(--border-lit); color: var(--text);
    padding: 11px 13px; border-radius: var(--radius-sm); font-family: var(--sans); font-size: .95rem;
}
.input:focus, textarea.input:focus, select.input:focus {
    outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px rgba(124,58,237,.15);
}
textarea.input { font-family: var(--mono); font-size: .88rem; resize: vertical; min-height: 120px; }
.form-hint { font-size: .8rem; color: var(--faint); margin-top: 6px; }
.auth-alt { text-align: center; color: var(--muted); margin-top: 18px; font-size: .9rem; }

/* ---- Room detail ----------------------------------------- */
.room-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 26px; margin-bottom: 10px; }
.room-header .cat { font-family: var(--mono); font-size: .76rem; letter-spacing: .08em; text-transform: uppercase; color: var(--brand); }
.room-header h1 { margin: 8px 0 10px; }
.room-header p { color: var(--muted); max-width: 64ch; }
.room-sidecard { min-width: 230px; }
.room-sidecard .card { padding: 20px; }
.room-stat { display: flex; justify-content: space-between; padding: 7px 0; font-size: .9rem; }
.room-stat span { color: var(--muted); }
.room-stat b { font-family: var(--mono); }

.task { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin-top: 20px; overflow: hidden; box-shadow: var(--shadow-sm); }
.task-head { padding: 18px 24px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 13px; }
.task-num { font-family: var(--display); color: #fff; background: linear-gradient(150deg, var(--brand-2), var(--brand)); font-weight: 700; width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; font-size: .9rem; flex-shrink: 0; }
.task-head h3 { margin: 0; font-size: 1.15rem; }
.task-body { padding: 22px 24px; }
.task-content { color: #362f45; margin-bottom: 4px; }
.task-content p { margin: 0 0 14px; line-height: 1.75; }
.task-content h4 { font-size: 1.12rem; margin: 22px 0 10px; color: var(--text); }
.task-content h5 { font-size: 1rem; margin: 18px 0 8px; color: var(--brand-dim); }
.task-content ul { margin: 0 0 14px; padding-left: 20px; }
.task-content li { margin: 5px 0; line-height: 1.65; }
.task-content code { font-size: .88em; }
.task-content pre { background: var(--ink-2); color: #eae6f5; border-radius: var(--radius-sm); padding: 14px 16px; overflow-x: auto; margin: 0 0 16px; }
.task-content pre code { background: none; color: inherit; padding: 0; font-size: .86rem; }
.task-content a { color: var(--brand); text-decoration: underline; }
.lesson-img { margin: 18px 0 20px; text-align: center; }
.lesson-img img { max-width: 100%; height: auto; border-radius: var(--radius); border: 1px solid var(--border); background: #fff; box-shadow: var(--shadow-sm); }
.lesson-img figcaption { margin-top: 8px; font-size: .82rem; color: var(--faint); font-style: italic; }
.task-content ol { margin: 0 0 14px; padding-left: 22px; }
.task-content ol li { margin: 6px 0; line-height: 1.65; }
.callout { margin: 16px 0; padding: 12px 16px 12px 15px; border-radius: var(--radius-sm); border-left: 4px solid var(--brand); background: var(--brand-soft); color: var(--text); line-height: 1.65; font-size: .95rem; }
.callout-label { font-weight: 700; font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; margin-right: 6px; color: var(--brand-dim); }
.callout code { background: rgba(20,16,25,.06); }
.callout-tip { border-left-color: #15a34a; background: #eafaf0; }
.callout-tip .callout-label { color: #15803d; }
.callout-warning { border-left-color: #dc2626; background: #fdecec; }
.callout-warning .callout-label { color: #b91c1c; }
.callout-note { border-left-color: #9a5cf3; background: #f4efff; }
.callout-note .callout-label { color: var(--brand-dim); }
.callout-info { border-left-color: var(--brand); background: var(--brand-soft); }
.callout-info .callout-label { color: var(--brand-dim); }

.question { border-top: 1px dashed var(--border); padding-top: 18px; margin-top: 18px; }
.question.first { border-top: 0; margin-top: 8px; }
.q-prompt { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.q-check { width: 24px; height: 24px; border-radius: 7px; border: 1px solid var(--border-lit); display: grid; place-items: center; flex-shrink: 0; font-size: .8rem; color: transparent; }
.question.solved .q-check { background: var(--success); border-color: var(--success); color: #fff; }
.q-prompt p { margin: 0; font-weight: 500; }
.q-points { font-family: var(--mono); font-size: .74rem; color: var(--gold); margin-left: auto; white-space: nowrap; }

.flag-form { display: flex; gap: 10px; align-items: stretch; }
.flag-input-wrap { flex: 1; display: flex; align-items: center; background: var(--surface-2); border: 1px solid var(--border-lit); border-radius: var(--radius-sm); padding: 0 12px; }
.flag-input-wrap:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(124,58,237,.15); background: var(--surface); }
.flag-input-wrap .prompt-char { font-family: var(--mono); color: var(--brand); margin-right: 8px; }
.flag-input { flex: 1; background: none; border: 0; color: var(--text); font-family: var(--mono); font-size: .9rem; padding: 11px 0; }
.flag-input:focus { outline: none; }
.question.solved .flag-input-wrap { border-color: var(--success); opacity: .85; }
.q-hint { font-size: .82rem; color: var(--faint); margin-top: 8px; }
.q-hint summary { cursor: pointer; color: var(--brand); }
.q-feedback { font-size: .85rem; margin-top: 8px; font-family: var(--mono); min-height: 1.1em; }
.q-feedback.ok { color: var(--success); }
.q-feedback.no { color: var(--danger); }

/* ---- Tables / leaderboard -------------------------------- */
.table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
.table th, .table td { text-align: left; padding: 13px 18px; border-bottom: 1px solid var(--border); }
.table th { font-family: var(--mono); font-size: .74rem; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); font-weight: 500; }
.table tbody tr:last-child td, .table tr:last-child td { border-bottom: 0; }
.table td.rank { font-family: var(--mono); color: var(--muted); width: 60px; }
.table tr.me { background: var(--brand-soft); }
.table .pts { font-family: var(--mono); color: var(--brand); text-align: right; font-weight: 600; }
.medal { font-size: 1.1rem; }

.podium { display: flex; align-items: flex-end; justify-content: center; gap: 18px; margin: 10px 0 30px; }
.podium-spot { display: flex; flex-direction: column; align-items: center; gap: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 22px; width: 180px; box-shadow: var(--shadow-sm); }
.podium-spot.place-1 { border-color: var(--brand); transform: translateY(-14px); box-shadow: var(--shadow); }
.podium-avatar { position: relative; width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; font-size: 1.4rem; font-weight: 700; color: #fff; font-family: var(--display); background: linear-gradient(150deg, var(--brand-2), var(--brand)); }
.podium-medal { position: absolute; bottom: -8px; right: -8px; font-size: 1.2rem; }
.podium-pts { font-family: var(--mono); color: var(--brand); font-weight: 600; }

/* ---- Dashboard ------------------------------------------- */
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 30px; }
.stat-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm); }
.stat-box .label { font-family: var(--mono); font-size: .72rem; letter-spacing: .05em; text-transform: uppercase; color: var(--faint); }
.stat-box .value { font-family: var(--display); font-size: 1.9rem; font-weight: 700; margin-top: 6px; }
.stat-box .value.accent { color: var(--brand); }
.stat-box .value.gold { color: var(--gold); }

/* ---- Admin ----------------------------------------------- */
.admin-bar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; }
.admin-section { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; margin-bottom: 20px; box-shadow: var(--shadow-sm); }
.admin-section h3 { margin-top: 0; }
.row-flex { display: flex; gap: 12px; }
.row-flex > * { flex: 1; }
.mini-list { list-style: none; padding: 0; margin: 10px 0 0; }
.mini-list li { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: .92rem; }
.mini-list li:last-child { border-bottom: 0; }
.tag { font-family: var(--mono); font-size: .72rem; color: var(--faint); }
.danger-link { color: var(--danger); font-size: .85rem; }

/* ---- Footer ---------------------------------------------- */
.site-footer { background: var(--ink); margin-top: auto; color: rgba(255,255,255,.7); }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 22px; padding: 34px 22px; flex-wrap: wrap; }
.site-footer .brand-name { color: #fff; font-family: var(--display); font-weight: 700; }
.footer-tag { color: rgba(255,255,255,.5); font-size: .85rem; margin: 6px 0 0; }
.footer-links { display: flex; gap: 20px; flex-wrap: wrap; }
.footer-links a { color: rgba(255,255,255,.72); font-size: .9rem; }
.footer-links a:hover { color: var(--brand-2); }
.footer-legal { color: rgba(255,255,255,.4); font-size: .8rem; width: 100%; margin: 8px 0 0; border-top: 1px solid rgba(255,255,255,.08); padding-top: 16px; }

.empty { text-align: center; padding: 64px 20px; color: var(--muted); }
.empty h3 { font-size: 1.3rem; }

/* ---- Chips / tags ---------------------------------------- */
.chip-row { display: flex; flex-wrap: wrap; gap: 7px; margin: 0 0 14px; }
.chip-row.big { gap: 10px; }
.chip { font-family: var(--mono); font-size: .72rem; color: var(--brand-dim); background: var(--brand-soft); border: 1px solid #e2d5ff; padding: 4px 11px; border-radius: 999px; text-decoration: none; }
a.chip:hover { border-color: var(--brand); text-decoration: none; }
.chip.lg { font-size: .85rem; padding: 9px 16px; }

/* ---- Filter bar ------------------------------------------ */
.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; margin: 4px 0 26px; align-items: center; }
.filter-bar .input { width: auto; }
.filter-search { flex: 1; min-width: 220px; }

/* ---- Feature grid / icon chips --------------------------- */
.feature { text-align: left; }
.icon-chip { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; font-size: 1.4rem; background: var(--brand-soft); color: var(--brand); margin-bottom: 12px; }
.feature h3 { margin: 0 0 6px; font-size: 1.12rem; }
.feature p { color: var(--muted); font-size: .93rem; margin: 0; }

/* ---- Learning-path cards --------------------------------- */
.path-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; }
.path-card { display: flex; text-decoration: none; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; transition: .16s; box-shadow: var(--shadow-sm); }
.path-card:hover { transform: translateY(-3px); border-color: var(--path-color, var(--brand)); text-decoration: none; box-shadow: var(--shadow); }
.path-emoji { flex: 0 0 84px; display: flex; align-items: center; justify-content: center; font-size: 2.3rem; background: color-mix(in srgb, var(--path-color, var(--brand)) 14%, #fff); border-right: 1px solid var(--border); }
.path-body { padding: 18px 20px; flex: 1; }
.path-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.path-top h3 { margin: 0 0 4px; font-size: 1.16rem; }
.path-body p { color: var(--muted); font-size: .92rem; margin: 6px 0 12px; }
.path-meta { display: flex; gap: 12px; margin-bottom: 8px; }

.path-hero { display: flex; gap: 26px; align-items: center; margin: 16px 0 26px; padding: 32px; border-radius: var(--radius); background: color-mix(in srgb, var(--path-color, var(--brand)) 9%, #fff); border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.path-hero-emoji { font-size: 3.4rem; }
.path-hero-text h1 { margin: 10px 0; font-size: 2rem; }
.path-hero-text p { color: var(--muted); max-width: 66ch; }
.path-hero-meta { display: flex; gap: 22px; margin: 16px 0 12px; font-family: var(--mono); font-size: .9rem; color: var(--muted); }
.path-hero-meta b { color: var(--text); }

.cert-banner, .cert-actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.cert-banner { padding: 18px 22px; margin-bottom: 22px; border-radius: var(--radius); flex-wrap: wrap; background: var(--brand-soft); border: 1px solid #d8c7ff; }
.cert-banner b { display: block; font-size: 1.05rem; }
.cert-banner span { color: var(--muted); }

.path-modules-title { margin: 30px 0 16px; }
.module-list { list-style: none; padding: 0; margin: 0; }
.module { display: flex; gap: 16px; }
.module-rail { display: flex; flex-direction: column; align-items: center; flex: 0 0 34px; }
.module-dot { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-family: var(--display); font-weight: 700; font-size: .9rem; background: var(--surface); border: 2px solid var(--border-lit); color: var(--muted); }
.module:not(:last-child) .module-rail::after { content: ''; width: 2px; flex: 1; background: var(--border-lit); margin: 4px 0; }
.module.done .module-dot { background: var(--brand); border-color: var(--brand); color: #fff; }
.module-card { flex: 1; margin-bottom: 16px; padding: 18px 20px; }
.module-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.module-head h4 { margin: 4px 0 0; font-size: 1.1rem; }
.module-head h4 a { color: var(--text); }
.module-head h4 a:hover { color: var(--brand); text-decoration: none; }
.module-badges { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.module-card p { color: var(--muted); font-size: .92rem; margin: 8px 0 14px; }
.module-foot { display: flex; align-items: center; gap: 12px; }
.module-status { font-family: var(--mono); font-size: .78rem; color: var(--muted); }
.module-status.done { color: var(--success); }
.module.locked .module-card { opacity: .9; }

/* ---- Certificate ----------------------------------------- */
.cert-actions { margin: 6px 0 18px; justify-content: flex-start; }
.certificate { background: #fff; border: 1px solid var(--border); border-radius: 18px; padding: 8px; box-shadow: var(--shadow-lg); }
.cert-inner { border: 1.5px solid var(--brand); border-radius: 13px; padding: 48px 40px; text-align: center; background: radial-gradient(560px 220px at 50% -10%, var(--brand-soft), transparent 70%); }
.cert-brand { margin-bottom: 26px; font-size: 1.15rem; font-family: var(--display); font-weight: 700; }
.cert-kicker { font-family: var(--mono); letter-spacing: .26em; text-transform: uppercase; color: var(--brand); font-size: .8rem; margin: 0 0 26px; }
.cert-awarded { color: var(--muted); margin: 6px 0; }
.cert-name { font-size: 2.6rem; margin: 8px 0 4px; font-family: var(--display); }
.cert-path { font-size: 1.5rem; margin: 10px 0 34px; color: var(--brand); }
.cert-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-top: 20px; }
.cert-sig { flex: 1; }
.cert-sig-line { display: block; font-family: var(--mono); border-bottom: 1px solid var(--border-lit); padding-bottom: 6px; }
.cert-sig-label { font-size: .74rem; color: var(--faint); text-transform: uppercase; letter-spacing: .1em; }
.cert-seal { font-size: 2.6rem; }
.cert-verify { text-align: center; color: var(--muted); margin-top: 16px; font-size: .85rem; }
.cert-verify code { color: var(--brand); }

/* ---- Badges gallery -------------------------------------- */
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.badge-card { text-align: center; padding: 24px 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.badge-card.locked { opacity: .6; }
.badge-card.unlocked { border-color: #d8c7ff; }
.badge-ic { font-size: 2.6rem; margin-bottom: 8px; }
.badge-card h3 { margin: 4px 0 6px; font-size: 1.05rem; }
.badge-card p { color: var(--muted); font-size: .85rem; margin: 0 0 10px; }
.badge-tick { font-family: var(--mono); font-size: .72rem; color: var(--brand); }

/* ---- Profile --------------------------------------------- */
.profile-head { display: flex; align-items: center; gap: 18px; margin-bottom: 10px; }
.profile-avatar { width: 66px; height: 66px; border-radius: 18px; display: grid; place-items: center; font-size: 1.9rem; font-weight: 700; color: #fff; font-family: var(--display); background: linear-gradient(150deg, var(--brand-2), var(--brand)); }
.badge-strip { display: flex; flex-wrap: wrap; gap: 10px; }
.badge-chip { display: flex; align-items: center; gap: 8px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 6px 14px 6px 8px; font-size: .85rem; }
.badge-chip-ic { font-size: 1.1rem; }
.skill { margin-bottom: 14px; }
.skill-top { display: flex; justify-content: space-between; font-size: .9rem; margin-bottom: 6px; }
.path-progress-row { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.path-progress-row:last-child { border-bottom: 0; }
.path-progress-emoji { font-size: 1.6rem; }
.path-progress-main { flex: 1; }
.path-progress-top { display: flex; justify-content: space-between; margin-bottom: 6px; font-size: .92rem; }

/* ---- Activity heatmap ------------------------------------ */
.heatmap { display: flex; gap: 3px; overflow-x: auto; padding-bottom: 6px; }
.heat-col { display: flex; flex-direction: column; gap: 3px; }
.heat-cell { width: 13px; height: 13px; border-radius: 3px; background: var(--surface-3); display: inline-block; }
.heat-cell.empty { background: transparent; }
.heat-cell.l0 { background: #eee7f9; }
.heat-cell.l1 { background: #d6c3f7; }
.heat-cell.l2 { background: #b590f2; }
.heat-cell.l3 { background: #9159ea; }
.heat-cell.l4 { background: var(--brand); }
.heat-legend { display: flex; align-items: center; gap: 5px; margin-top: 10px; font-size: .76rem; color: var(--faint); }

/* ---- Star ratings ---------------------------------------- */
.rating-mini { display: inline-flex; align-items: center; gap: 5px; }
.rating-mini .star { color: #d8cfe6; font-size: .95rem; line-height: 1; }
.rating-mini .star.on { color: #f5a623; }
.rating-mini .star.half { background: linear-gradient(90deg, #f5a623 50%, #d8cfe6 50%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.reviews { margin-top: 42px; }
.review-form { padding: 20px; margin-bottom: 20px; }
.review-form-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; gap: 12px; }
.review-form textarea { min-height: 70px; margin-bottom: 12px; }
.star-input { display: inline-flex; flex-direction: row-reverse; }
.star-input input { display: none; }
.star-input label { color: #d8cfe6; font-size: 1.5rem; cursor: pointer; padding: 0 1px; line-height: 1; }
.star-input label:hover, .star-input label:hover ~ label, .star-input input:checked ~ label { color: #f5a623; }
.review-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.review-list li { padding: 16px 18px; }
.review-top { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.review-author { font-weight: 600; }
.review-list p { margin: 0; color: var(--muted); font-size: .92rem; }

/* ---- CTA band -------------------------------------------- */
.cta-band { text-align: center; padding: 56px 20px; margin-top: 40px; border-radius: var(--radius); color: #fff; background: linear-gradient(135deg, var(--brand), #5b21b6); box-shadow: var(--shadow); }
.cta-band h2 { color: #fff; font-size: 2rem; margin: 0 0 8px; }
.cta-band p { color: rgba(255,255,255,.85); margin: 0 0 22px; }
.cta-band .btn-primary { background: #fff; color: var(--brand-dim); }
.cta-band .btn-primary:hover { background: #f3ecff; }

/* ---- Achievement toasts ---------------------------------- */
.toast-host { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 10px; z-index: 1000; }
.toast { display: flex; align-items: center; gap: 12px; min-width: 250px; background: var(--surface); border: 1px solid var(--brand); border-radius: 13px; padding: 13px 16px; box-shadow: var(--shadow-lg); transform: translateX(120%); opacity: 0; transition: transform .35s cubic-bezier(.2,.7,.3,1), opacity .35s; }
.toast.show { transform: translateX(0); opacity: 1; }
.toast-ic { font-size: 1.8rem; }
.toast-body { display: flex; flex-direction: column; }
.toast-body b { font-size: .72rem; color: var(--brand); text-transform: uppercase; letter-spacing: .06em; }

/* ---- Pricing --------------------------------------------- */
.pricing-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; align-items: stretch; margin-top: 10px; }
.plan-card { position: relative; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px 24px; box-shadow: var(--shadow-sm); }
.plan-card.featured { border: 2px solid var(--brand); box-shadow: var(--shadow); }
.plan-card.is-current { border-color: var(--border-lit); }
.plan-flag { position: absolute; top: -12px; left: 24px; background: var(--brand); color: #fff; font-family: var(--mono); font-size: .68rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 4px 11px; border-radius: 999px; }
.plan-name { margin: 4px 0; font-size: 1.4rem; }
.plan-tagline { color: var(--muted); font-size: .9rem; margin: 0 0 16px; min-height: 2.6em; }
.plan-price { display: flex; align-items: baseline; gap: 6px; margin-bottom: 18px; }
.plan-amount { font-size: 2.1rem; font-weight: 700; font-family: var(--display); }
.plan-period { color: var(--faint); font-family: var(--mono); font-size: .82rem; }
.plan-features { list-style: none; padding: 0; margin: 0 0 22px; flex: 1; }
.plan-features li { position: relative; padding: 7px 0 7px 26px; color: var(--text); font-size: .92rem; border-bottom: 1px solid var(--border); }
.plan-features li::before { content: '\2713'; position: absolute; left: 0; top: 7px; color: var(--brand); font-weight: 700; }
.plan-features.tight li { border: 0; padding: 4px 0 4px 24px; font-size: .86rem; }
.plan-cta { width: 100%; text-align: center; }
.pricing-foot { margin-top: 30px; text-align: center; }
.pricing-foot p { margin: 6px 0; }
.fineprint { font-family: var(--mono); font-size: .76rem; color: var(--faint); }

/* ---- Checkout -------------------------------------------- */
.checkout { display: grid; grid-template-columns: 1.5fr 1fr; gap: 26px; align-items: start; }
.checkout-main h2 { margin: 14px 0 8px; }
.checkout-form h3 { margin: 22px 0 12px; font-size: 1.05rem; }
.demo-note { background: var(--brand-soft); border: 1px solid #d8c7ff; color: var(--brand-dim); padding: 14px 16px; border-radius: var(--radius-sm); font-size: .9rem; margin: 16px 0 22px; }
.checkout-summary { padding: 22px; position: sticky; top: 90px; }
.checkout-summary h3 { margin: 0 0 14px; }
.summary-row { display: flex; justify-content: space-between; padding: 7px 0; font-size: .92rem; }
.summary-row.muted span { color: var(--muted); }
.summary-row b { font-family: var(--mono); }
.checkout-summary hr { border: 0; border-top: 1px solid var(--border); margin: 12px 0; }

/* ---- Corporate / team ------------------------------------ */
.corp-hero { text-align: center; padding: 30px 0 10px; }
.corp-hero h1 { font-size: 2.6rem; margin: 8px 0 14px; }
.corp-lead { color: var(--muted); max-width: 60ch; margin: 0 auto 24px; font-size: 1.05rem; }
.corp-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.corp-features { margin-top: 40px; }
.feature-ic { font-size: 1.8rem; margin-bottom: 8px; }
.corp-banner { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 44px; padding: 30px; flex-wrap: wrap; border-radius: var(--radius); background: var(--brand-soft); border: 1px solid #d8c7ff; }
.corp-banner h3 { margin: 0 0 6px; }
.corp-banner p { color: var(--muted); margin: 0; }
.team-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 22px; align-items: start; }
.team-grid .card { padding: 22px; }
.team-grid h3 { margin: 0 0 14px; }
.table.compact th, .table.compact td { padding: 9px 12px; font-size: .88rem; }
.team-invite { margin-top: 22px; border-top: 1px solid var(--border); padding-top: 18px; }
.team-invite h4 { margin: 0 0 10px; font-size: .95rem; }
.invite-form { display: flex; gap: 8px; flex-wrap: wrap; }
.invite-form .input { flex: 1; min-width: 140px; }
.invite-form select.input { flex: 0 0 auto; width: auto; }
.invite-list { list-style: none; padding: 0; margin: 10px 0 0; }
.invite-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.invite-link { display: block; width: 100%; margin-top: 6px; font-family: var(--mono); font-size: .74rem; color: var(--brand); background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: 6px 8px; }
.assign-list { list-style: none; padding: 0; margin: 0; }
.assign-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 8px; background: var(--surface-2); }
.assign-list li.on { border-color: var(--brand); background: var(--brand-soft); }
.plan-line { margin: 0 0 14px; }
.paywall { text-align: center; max-width: 620px; margin: 30px auto; padding: 44px 30px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.paywall-lock { font-size: 2.6rem; margin-bottom: 6px; color: var(--brand); }
.paywall h3 { margin: 0 0 10px; font-size: 1.3rem; }
.paywall p { color: var(--muted); margin: 0 auto 20px; max-width: 46ch; }
.paywall-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.paywall-note { font-family: var(--mono); font-size: .78rem; color: var(--faint); margin-top: 20px; }

/* ============================================================
   HACKTIVITIES  (Learn hub + roadmap)
   ============================================================ */
.htb-hero { position: relative; overflow: hidden; margin: 12px 0 8px; padding: 44px 40px; border-radius: 20px; color: #fff; background: linear-gradient(135deg, #2a1150 0%, #4c1d95 45%, #7c3aed 100%); box-shadow: var(--shadow); }
.htb-hero::after { content: ''; position: absolute; right: -60px; top: -60px; width: 320px; height: 320px; border-radius: 50%; background: radial-gradient(circle, rgba(160,107,255,.5), transparent 70%); }
.htb-hero-eyebrow { font-family: var(--mono); letter-spacing: .18em; text-transform: uppercase; font-size: .78rem; color: #d9c7ff; display: inline-flex; align-items: center; gap: 8px; }
.htb-hero h1 { color: #fff; font-size: clamp(2rem, 4vw, 2.9rem); margin: 12px 0; }
.htb-hero p { color: rgba(255,255,255,.82); max-width: 60ch; margin: 0; font-size: 1.06rem; }
.htb-stats { display: flex; gap: 34px; margin-top: 26px; position: relative; z-index: 1; }
.htb-stat b { font-family: var(--display); font-size: 1.7rem; display: block; }
.htb-stat span { color: rgba(255,255,255,.7); font-size: .82rem; }

.htb-tabs { display: flex; gap: 4px; flex-wrap: wrap; margin: 26px 0 30px; border-bottom: 1px solid var(--border); }
.htb-tab { display: inline-flex; align-items: center; gap: 8px; padding: 12px 16px; color: var(--muted); font-weight: 600; font-size: .95rem; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.htb-tab .ti { font-size: 1.1rem; }
.htb-tab:hover { color: var(--text); text-decoration: none; }
.htb-tab.active { color: var(--brand); border-bottom-color: var(--brand); }

/* Roadmap tracks */
.track { margin-bottom: 34px; }
.track-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.track-ic { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; font-size: 1.4rem; color: #fff; flex-shrink: 0; background: linear-gradient(150deg, var(--brand-2), var(--brand)); }
.track-head h3 { margin: 0; font-size: 1.3rem; }
.track-head p { margin: 2px 0 0; color: var(--muted); font-size: .92rem; }
.track-rail { border-left: 2px dashed var(--border-lit); margin-left: 22px; padding: 4px 0 4px 30px; }
.rm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.rm-card { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; text-decoration: none; color: var(--text); transition: .16s; box-shadow: var(--shadow-sm); border-left: 4px solid var(--path-color, var(--brand)); }
.rm-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); text-decoration: none; border-color: var(--border-lit); border-left-color: var(--path-color, var(--brand)); }
.rm-top { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.rm-emoji { font-size: 1.5rem; }
.rm-type { font-family: var(--mono); font-size: .66rem; letter-spacing: .08em; text-transform: uppercase; color: var(--brand); background: var(--brand-soft); padding: 3px 8px; border-radius: 999px; margin-left: auto; }
.rm-card h4 { margin: 0 0 6px; font-size: 1.06rem; }
.rm-card p { color: var(--muted); font-size: .88rem; margin: 0 0 12px; }
.rm-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.rm-cert { font-family: var(--mono); font-size: .7rem; color: var(--gold); display: inline-flex; align-items: center; gap: 4px; }

/* ---- Responsive ------------------------------------------ */
@media print {
    .site-header, .site-footer, .no-print, .toast-host { display: none !important; }
    body { background: #fff; }
    .certificate { box-shadow: none; }
}

@media (max-width: 900px) {
    .hero { grid-template-columns: 1fr; }
    .grid-3, .grid-2, .pricing-grid, .checkout, .team-grid { grid-template-columns: 1fr; }
    .checkout-summary { position: static; }
    .path-hero, .htb-hero { flex-direction: column; }
    .nav-toggle { display: flex; }
    .site-nav {
        position: fixed; inset: 68px 0 auto 0; background: var(--ink);
        flex-direction: column; align-items: stretch; gap: 2px; padding: 12px 18px 20px;
        border-bottom: 1px solid rgba(255,255,255,.08); display: none;
    }
    body.nav-open .site-nav { display: flex; }
    .site-nav > a { padding: 12px 10px; }
    /* User menu: expand inline inside the mobile drawer instead of floating */
    .nav-menu { display: block; width: 100%; }
    .nav-user { width: 100%; justify-content: flex-start; border-radius: 10px; }
    .nav-user-name { margin-right: auto; }
    .nav-dropdown {
        position: static; opacity: 1; visibility: visible; transform: none; min-width: 0;
        background: transparent; border: none; box-shadow: none; padding: 6px 0 0;
    }
    .nav-dropdown-head { display: none; }
    .nav-dropdown > a { color: rgba(255,255,255,.82); padding: 11px 10px; }
    .nav-dropdown > a .ti { color: rgba(255,255,255,.5); }
    .nav-dropdown > a:hover { background: rgba(255,255,255,.08); color: #fff; }
    .nav-dropdown-sep { background: rgba(255,255,255,.12); }
    .nav-caret { display: none; }
    .htb-hero { padding: 30px 24px; }
    .htb-stats { flex-wrap: wrap; gap: 20px; }
    .track-rail { padding-left: 18px; margin-left: 10px; }
}

/* ---- Checkout: payment methods (Card / PayPal / UPI) ---- */
.pay-methods { display: flex; gap: 10px; margin: 8px 0 18px; flex-wrap: wrap; }
.pay-tab {
    flex: 1 1 120px; display: flex; align-items: center; gap: 8px; cursor: pointer;
    border: 2px solid var(--border, #e7e1f2); border-radius: 12px; padding: 12px 14px;
    background: #fff; font-weight: 600; transition: border-color .15s, background .15s;
}
.pay-tab:hover { border-color: #c9bfe6; }
.pay-tab.is-active { border-color: var(--brand, #7c3aed); background: #faf7ff; }
.pay-tab input { accent-color: var(--brand, #7c3aed); }
.pay-tab-icon { font-size: 18px; }
.pay-panel { margin-bottom: 18px; }

.btn-paypal { background: #ffc439; color: #142c8e; border: none; }
.btn-paypal:hover { background: #f0b72e; }

.upi-box { display: flex; gap: 20px; flex-wrap: wrap; align-items: flex-start;
    border: 1px solid var(--border, #e7e1f2); border-radius: 14px; padding: 18px; background: #faf9ff; }
.upi-qr { text-align: center; }
.upi-qr #upi-qr { width: 172px; height: 172px; background: #fff; border-radius: 10px;
    display: flex; align-items: center; justify-content: center; padding: 6px; box-shadow: 0 1px 6px rgba(24,16,40,.08); }
.upi-qr #upi-qr img, .upi-qr #upi-qr canvas { border-radius: 6px; }
.upi-qr .fineprint { display: block; margin-top: 8px; }
.upi-info { flex: 1 1 260px; }
.upi-vpa { display: flex; align-items: center; gap: 10px; margin: 6px 0 14px; }
.upi-vpa code { background: #ede4ff; color: #5b21b6; padding: 6px 10px; border-radius: 8px; font-size: 15px; }
.upi-amount { color: var(--brand, #7c3aed); }
.upi-open { display: inline-flex; }
@media (max-width: 520px) { .upi-box { flex-direction: column; align-items: center; text-align: center; } }

/* ---- Admin dashboard ---- */
.stat-grid {
    display: grid; gap: 14px; margin-bottom: 26px;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}
.stat-card {
    background: #fff; border: 1px solid var(--border, #e7e1f2); border-radius: 14px;
    padding: 16px 18px; display: flex; flex-direction: column; gap: 4px;
}
.stat-card.accent { border-color: var(--brand, #7c3aed); background: #faf7ff; }
.stat-label { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted, #635d73); font-weight: 600; }
.stat-value { font-size: 26px; font-weight: 700; color: #17131f; line-height: 1.15; }
.stat-card.accent .stat-value { color: var(--brand, #7c3aed); }
.stat-sub { font-size: 12px; color: var(--muted, #635d73); }

.admin-grid { display: grid; gap: 18px; grid-template-columns: 2fr 1fr; margin-bottom: 26px; }
@media (max-width: 780px) { .admin-grid { grid-template-columns: 1fr; } }

.sys-list { list-style: none; margin: 0; padding: 0; }
.sys-list li {
    display: flex; justify-content: space-between; gap: 12px;
    padding: 8px 0; border-bottom: 1px solid var(--border, #e7e1f2); font-size: 13px;
}
.sys-list li:last-child { border-bottom: 0; }
.sys-list span { color: var(--muted, #635d73); }
.sys-list b { color: #17131f; }

.badge-warn {
    background: #fff7ed; color: #b45309; border: 1px solid #fed7aa;
    border-radius: 999px; padding: 1px 7px; font-size: 11px; font-weight: 600;
}
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, #7c3aed 50%), linear-gradient(135deg, #7c3aed 50%, transparent 50%); background-position: calc(100% - 18px) 52%, calc(100% - 13px) 52%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 36px; }
textarea.input { font-family: inherit; resize: vertical; }

/* checkbox label under secret fields */
.check { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted, #635d73); margin-top: 6px; cursor: pointer; }
.check input { accent-color: var(--brand, #7c3aed); }

/* ---- SSO + 2FA ---- */
.sso-divider { display: flex; align-items: center; text-align: center; color: var(--muted, #635d73); font-size: 12px; margin: 16px 0; }
.sso-divider::before, .sso-divider::after { content: ""; flex: 1; height: 1px; background: var(--border, #e7e1f2); }
.sso-divider span { padding: 0 12px; }
.btn-google { display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    background: #fff; color: #3c4043; border: 1px solid #dadce0; font-weight: 600; }
.btn-google:hover { background: #f7f8f8; border-color: #d2d5d9; }

.twofa-enrol { display: flex; gap: 24px; flex-wrap: wrap; align-items: flex-start; margin-top: 12px; }
#totp-qr { width: 180px; height: 180px; background: #fff; padding: 6px; border-radius: 10px;
    border: 1px solid var(--border, #e7e1f2); display: flex; align-items: center; justify-content: center; }
.totp-key { display: inline-block; background: #ede4ff; color: #5b21b6; padding: 8px 12px;
    border-radius: 8px; font-size: 15px; letter-spacing: 2px; word-break: break-all; }
.backup-codes { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; margin-top: 12px; }
.backup-codes code { background: #fff; border: 1px solid var(--border, #e7e1f2); border-radius: 8px;
    padding: 8px 10px; text-align: center; font-size: 14px; letter-spacing: 1px; }

/* ---- Uploaded images: avatars + room logos ---- */
img.profile-avatar { width: 84px; height: 84px; border-radius: 50%; object-fit: cover;
    border: 2px solid var(--border, #e7e1f2); background: #fff; }
.avatar-edit { display: flex; gap: 16px; align-items: center; margin-bottom: 16px; }
.avatar-lg { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; border: 1px solid var(--border, #e7e1f2); background: #fff; }
.nav-avatar { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; vertical-align: middle; margin-right: 6px; }
.profile-bio { margin: 8px 0 6px; color: var(--muted, #635d73); max-width: 640px; }
.profile-social { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; }
.profile-social a { color: var(--brand, #7c3aed); font-weight: 600; }
.profile-social span { color: var(--muted, #635d73); }

.room-logo { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; margin-bottom: 8px;
    border: 1px solid var(--border, #e7e1f2); background: #fff; }
.room-logo-lg { width: 64px; height: 64px; border-radius: 14px; object-fit: cover; margin-bottom: 10px;
    border: 1px solid var(--border, #e7e1f2); background: #fff; }
.room-logo-preview { width: 64px; height: 64px; border-radius: 12px; object-fit: cover;
    border: 1px solid var(--border, #e7e1f2); background: #fff; }
input[type=file].input { padding: 8px; }

/* ============================================================
   RESPONSIVE LAYER — phones, tablets, desktops
   ============================================================ */

/* Tablet / large phone */
@media (max-width: 820px) {
    .row-flex { flex-wrap: wrap; }
    .row-flex > * { flex: 1 1 100%; min-width: 0; }

    .room-header { flex-direction: column; gap: 16px; }
    .room-sidecard { min-width: 0; width: 100%; }

    .section-head { flex-direction: column; align-items: flex-start; gap: 12px; }
    .section-head form,
    .section-head > div { width: 100%; }

    .profile-head { flex-direction: column; text-align: center; align-items: center; }
    .profile-social { justify-content: center; }
    .twofa-enrol { flex-direction: column; }
    .avatar-edit { align-items: flex-start; }

    .stat-row { grid-template-columns: repeat(2, 1fr); gap: 12px; }

    /* Wide tables scroll instead of breaking the layout */
    .table { display: block; width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }

    .admin-grid .stat-grid { grid-template-columns: 1fr; }
}

/* Keep the mobile menu usable when it has many items */
@media (max-width: 900px) {
    body.nav-open .site-nav { max-height: calc(100vh - 68px); overflow-y: auto; }
    .site-nav .nav-user { justify-content: flex-start; flex-wrap: wrap; }
    .site-nav .btn { align-self: flex-start; }
}

/* Phones */
@media (max-width: 480px) {
    h1 { font-size: 1.7rem; line-height: 1.15; }
    h2 { font-size: 1.35rem; }
    .page { padding-top: 20px; padding-bottom: 40px; }

    .stat-row { grid-template-columns: 1fr 1fr; }
    .stat-grid { grid-template-columns: 1fr; }

    .pay-methods { flex-direction: column; }
    .pay-tab { flex-basis: auto; }

    .backup-codes { grid-template-columns: 1fr 1fr; }
    .avatar-edit { flex-direction: column; }

    /* Primary actions go full-width for easy tapping */
    .btn-lg { width: 100%; justify-content: center; }
    .btn-block { width: 100%; }

    /* Comfortable tap targets + no iOS zoom on focus (needs >=16px) */
    .input, select.input, textarea.input { font-size: 16px; }
    .btn { padding: 10px 14px; }

    .upi-qr #upi-qr { width: 150px; height: 150px; }
    #totp-qr { width: 160px; height: 160px; }
}

/* Very small phones */
@media (max-width: 360px) {
    .stat-row { grid-template-columns: 1fr; }
    .backup-codes { grid-template-columns: 1fr; }
}

/* ---- Orders, coupons, affiliates ---- */
.filter-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.filter-tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-right: auto; }
.filter-tab { padding: 7px 13px; border-radius: 999px; font-size: 13px; font-weight: 600;
    color: var(--muted, #635d73); border: 1px solid var(--border, #e7e1f2); background: #fff; }
.filter-tab:hover { border-color: #c9bfe6; text-decoration: none; }
.filter-tab.is-active { background: var(--brand, #7c3aed); color: #fff; border-color: var(--brand, #7c3aed); }
.filter-bar .input { max-width: 220px; }

tr.row-pending { background: #fffbeb; }
tr.row-pending td { border-color: #fde68a; }

.badge.status-paid, .badge.status-approved { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.badge.status-pending { background: #fffbeb; color: #b45309; border: 1px solid #fde68a; }
.badge.status-rejected, .badge.status-cancelled { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.badge.status-refunded { background: #f3f4f6; color: #4b5563; border: 1px solid #e5e7eb; }
.mono { font-family: var(--mono, monospace); }

/* Coupon field at checkout */
.coupon-box { border: 1px dashed var(--border, #e7e1f2); border-radius: 12px; padding: 14px 16px; margin: 18px 0; background: #fcfbff; }
.coupon-box label { font-weight: 600; display: block; margin-bottom: 8px; }
.coupon-row { display: flex; gap: 8px; }
.coupon-row .input { flex: 1; text-transform: uppercase; }
.coupon-ok { color: #047857; }
.coupon-bad { color: #b91c1c; }

.summary-row.discount { color: #047857; }
.summary-row.total { font-size: 1.05rem; padding-top: 8px; border-top: 1px solid var(--border, #e7e1f2); }

@media (max-width: 600px) {
    .filter-bar .input { max-width: 100%; flex: 1 1 100%; }
    .coupon-row { flex-direction: column; }
}

/* ---- Legal / policy pages ---- */
.legal { max-width: 780px; }
.legal h3 { margin: 28px 0 10px; font-size: 1.05rem; }
.legal p, .legal li { color: #3f3a4d; line-height: 1.75; }
.legal ul { margin: 10px 0 10px 20px; }
.legal li { margin-bottom: 8px; }
.danger-zone { border-color: rgba(248,113,113,.35); background: #fffafa; }
.danger-zone h3 { color: #b91c1c; }

/* ============================================================
   MARKETING / INFO PAGES
   ============================================================ */
.marketing { max-width: 1080px; margin: 0 auto; }
.mk-hero { text-align: center; padding: 24px 0 36px; max-width: 780px; margin: 0 auto; }
.mk-hero h1 { font-size: 2.4rem; line-height: 1.1; margin: 8px 0 16px; }
.mk-lead { font-size: 1.12rem; color: #4b4560; line-height: 1.7; }
.mk-lead em { color: var(--brand, #7c3aed); font-style: normal; font-weight: 600; }

.mk-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin: 8px 0 40px; }
.mk-stat { text-align: center; background: #faf7ff; border: 1px solid var(--border, #e7e1f2); border-radius: 14px; padding: 22px 12px; }
.mk-num { display: block; font-size: 2rem; font-weight: 700; color: var(--brand, #7c3aed); }
.mk-lbl { display: block; font-size: .82rem; color: var(--muted, #635d73); text-transform: uppercase; letter-spacing: .04em; margin-top: 4px; }

.mk-block { padding: 34px 0; border-top: 1px solid var(--border, #e7e1f2); }
.mk-block > h2 { font-size: 1.7rem; margin-bottom: 8px; }
.mk-sub { color: var(--muted, #635d73); margin-bottom: 20px; }

.mk-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin-top: 20px; }
.mk-card { background: #fff; border: 1px solid var(--border, #e7e1f2); border-radius: 14px; padding: 20px; }
.mk-card h3 { font-size: 1.08rem; margin-bottom: 8px; }
.mk-card p { color: #4b4560; line-height: 1.6; font-size: .95rem; }
.mk-card em { color: var(--brand, #7c3aed); font-style: normal; font-weight: 600; }

.mk-split { display: grid; grid-template-columns: 1.4fr 1fr; gap: 32px; align-items: start; }
.mk-aside { background: #faf7ff; border: 1px solid var(--border, #e7e1f2); border-radius: 14px; padding: 22px; }
.mk-aside h3 { font-size: 1.05rem; margin-bottom: 8px; }
.mk-aside p { color: #4b4560; line-height: 1.6; font-size: .95rem; }

.mk-check, .mk-ol { margin: 14px 0; padding-left: 0; list-style: none; }
.mk-check li { position: relative; padding-left: 28px; margin-bottom: 12px; line-height: 1.6; color: #3f3a4d; }
.mk-check li::before { content: "✓"; position: absolute; left: 0; top: 0; color: #fff; background: var(--brand, #7c3aed);
    width: 19px; height: 19px; border-radius: 50%; font-size: 12px; display: flex; align-items: center; justify-content: center; }
.mk-check b { color: #17131f; }
.mk-ol { counter-reset: s; }
.mk-ol li { position: relative; padding-left: 30px; margin-bottom: 10px; counter-increment: s; line-height: 1.6; color: #3f3a4d; }
.mk-ol li::before { content: counter(s); position: absolute; left: 0; top: 0; background: #ede4ff; color: #5b21b6;
    width: 21px; height: 21px; border-radius: 50%; font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; }

.mk-steps { display: flex; flex-direction: column; gap: 4px; margin: 20px 0; }
.mk-step { position: relative; padding: 18px 18px 18px 66px; border: 1px solid var(--border, #e7e1f2);
    border-radius: 14px; background: #fff; }
.mk-step-n { position: absolute; left: 16px; top: 18px; width: 36px; height: 36px; border-radius: 50%;
    background: var(--brand, #7c3aed); color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.mk-step h3 { font-size: 1.1rem; margin-bottom: 4px; }
.mk-step p { color: #4b4560; line-height: 1.6; }

.mk-faq-group { padding: 22px 0; border-top: 1px solid var(--border, #e7e1f2); }
.mk-faq-group > h2 { font-size: 1.35rem; margin-bottom: 12px; }
.mk-faq { border: 1px solid var(--border, #e7e1f2); border-radius: 12px; padding: 4px 16px; margin-bottom: 10px; background: #fff; }
.mk-faq summary { cursor: pointer; font-weight: 600; padding: 12px 0; list-style: none; position: relative; padding-right: 28px; }
.mk-faq summary::-webkit-details-marker { display: none; }
.mk-faq summary::after { content: "+"; position: absolute; right: 4px; top: 10px; font-size: 1.3rem; color: var(--brand, #7c3aed); }
.mk-faq[open] summary::after { content: "−"; }
.mk-faq p { padding: 0 0 14px; color: #4b4560; line-height: 1.7; }

.mk-cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.mk-cat { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px;
    background: #fff; border: 1px solid var(--border, #e7e1f2); border-radius: 12px; }
.mk-cat:hover { border-color: #c9bfe6; text-decoration: none; }
.mk-cat-name { font-weight: 600; color: #17131f; }
.mk-cat-n { font-size: .82rem; color: var(--muted, #635d73); }

.mk-path { border: 1px solid var(--border, #e7e1f2); border-radius: 14px; padding: 20px; margin-bottom: 16px; background: #fff; }
.mk-path-head { display: flex; justify-content: space-between; align-items: start; gap: 16px; margin-bottom: 12px; }
.mk-path-head h3 { font-size: 1.2rem; }
.mk-path-count { flex-shrink: 0; font-size: .8rem; color: var(--muted, #635d73); background: #f4f1fa; padding: 4px 10px; border-radius: 999px; }
.mk-path-rooms { margin: 12px 0; padding-left: 20px; }
.mk-path-rooms li { margin-bottom: 8px; line-height: 1.5; }
.mk-path-rooms .badge { margin-left: 6px; }

.mk-plan { text-align: center; }
.mk-price { font-size: 1.6rem; font-weight: 700; color: var(--brand, #7c3aed); margin: 6px 0; }
.mk-price span { font-size: .82rem; color: var(--muted, #635d73); font-weight: 500; }

.mk-cta { text-align: center; padding: 44px 24px; margin: 36px 0 8px; background: linear-gradient(135deg, #f5f0ff, #faf7ff);
    border: 1px solid var(--border, #e7e1f2); border-radius: 18px; }
.mk-cta h2 { font-size: 1.8rem; margin-bottom: 8px; }
.mk-cta p { color: #4b4560; margin-bottom: 20px; }
.mk-cta-btns { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

@media (max-width: 820px) {
    .mk-hero h1 { font-size: 1.9rem; }
    .mk-stats { grid-template-columns: repeat(2, 1fr); }
    .mk-split { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
    .mk-num { font-size: 1.6rem; }
    .mk-cta h2, .mk-block > h2 { font-size: 1.4rem; }
    .mk-cta-btns .btn { width: 100%; }
}

/* ---- Footer columns ---- */
.footer-cols { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; margin: 8px 0 20px; }
.footer-col h4 { font-size: .82rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted, #635d73); margin-bottom: 10px; }
.footer-col a { display: block; padding: 4px 0; color: #cfc9dd; font-size: .9rem; }
.footer-col a:hover { color: #fff; }
@media (max-width: 700px) { .footer-cols { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 380px) { .footer-cols { grid-template-columns: 1fr; } }

/* ---- Dashboard quick links (hub) ---- */
.dash-links {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px; margin: 8px 0 28px;
}
.dash-link {
    display: flex; align-items: center; gap: 10px; padding: 14px 16px;
    background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
    color: var(--text); font-weight: 600; font-size: .92rem; transition: border-color .15s, transform .15s, box-shadow .15s;
}
.dash-link .ti { font-size: 1.25rem; color: var(--brand); }
.dash-link:hover { border-color: var(--brand); transform: translateY(-2px); box-shadow: var(--shadow-sm); text-decoration: none; }
.dash-link-admin .ti { color: var(--brand-dim); }
@media (max-width: 640px) { .dash-links { grid-template-columns: repeat(2, 1fr); } }
