/* ============================================================================
   gate.css — gate-SPECIFIC pieces for the fulfillment + KB pages, layered on
   css/tokens.css + css/components.css. Only what the component library doesn't
   already provide: the navy hero band with the gold rule, keyset/file rows,
   version tags, preview banner, admin type-ahead, saved-ID lists, KB steps,
   and print rules so keys/files pages print clean.
   Charter: dual-tone --focus comes from components.css (never overridden),
   44px+ targets, state never by color alone, fluid to 320px.
   ========================================================================== */

/* ---- page shell ---- */
.gate-wrap { max-width: 42rem; margin: 0 auto; }
.kb-wrap { max-width: 46rem; margin: 0 auto; }

/* ---- the card + navy hero band with gold rule (ported from the old .card .top) ---- */
.gcard { background: var(--surface); border: 2px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--sh-lg); overflow: hidden; margin: 1.2rem 0; }
.gtop { background: var(--hero-grad); color: #fff; border-bottom: 4px solid var(--gold);
  padding: 1.5rem clamp(1rem, 4vw, 2rem) 1.3rem; }
.gtop .eyebrow { margin: 0; font-size: .72rem; font-weight: 800; letter-spacing: .12em;
  text-transform: uppercase; color: var(--gold); }
.gtop h1 { margin: .45rem 0 0; font-family: var(--serif); font-weight: 600; color: #fff;
  font-size: clamp(1.4rem, 4.4vw, 1.95rem); line-height: 1.15; letter-spacing: -.01em;
  text-wrap: balance; }
.gtop .gsub { margin: .5rem 0 0; color: #d7e6f2; font-size: .95rem; max-width: 50ch; }
.gbody { padding: clamp(1.1rem, 4vw, 1.8rem); }

/* ---- headings inside the gate body ---- */
.gh2 { font-size: 1.18rem; margin: 1.5rem 0 .6rem; letter-spacing: -.01em; color: var(--ink); }
.gbody > .gh2:first-child, .gbody section > .gh2:first-child { margin-top: 0; }
.lede { font-size: 1rem; color: var(--body); margin: 0 0 1rem; }
.fine { font-size: .85rem; color: var(--muted); margin-top: .9rem; }

/* ---- verified-holder chip ---- */
.who { display: flex; align-items: center; gap: .7rem; border: 2px solid var(--line);
  border-radius: .7rem; background: var(--surface-2); padding: .6rem .8rem; margin: 0 0 1rem; }
.who .av { flex: none; width: 2.5rem; height: 2.5rem; border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), #e0a800); color: #3a2c00;
  display: grid; place-items: center; font-weight: 800; font-size: .85rem; }
.who .n b { display: block; color: var(--ink); font-size: .98rem; }
.who .n .sub { display: block; font-size: .82rem; color: var(--muted); }

/* product badge next to the lede (pairs with .pill) */
.gbadge { margin: 0 0 .9rem; }

/* ---- key sets (one per seat) ---- */
.keyset { margin: 0 0 1rem; }
.keyset + .keyset { padding-top: .9rem; border-top: 2px dashed var(--line); }
.setlabel { font-size: .78rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 .55rem; }
.keys { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .55rem; }
.keyrow { display: flex; align-items: center; gap: .65rem; flex-wrap: wrap;
  border: 2px solid var(--line); border-radius: .7rem; background: var(--surface-2);
  padding: .55rem .7rem; }
.vtag { flex: none; font-size: .72rem; font-weight: 800; letter-spacing: .03em;
  color: var(--ink); background: var(--surface); border: 2px solid var(--line);
  border-radius: .45rem; padding: .3em .6em; min-width: 6.2rem; text-align: center; }
.kv { flex: 1; min-width: 12ch; font-family: var(--mono); font-size: .95rem; color: var(--ink);
  letter-spacing: .02em; overflow-wrap: anywhere; }
@media (max-width: 33rem) { .keyrow .kv { flex-basis: 100%; order: 3; } }
.cpall { margin-top: .6rem; }

/* copy success/failure cue — words + icon + border, never color alone */
.btn.cp.copied, .btn.cpall.copied { background: var(--good-bg); color: var(--good);
  border: 2px solid var(--good); }
.btn.cp.copyfail, .btn.cpall.copyfail { background: var(--bad-bg); color: var(--bad);
  border: 2px solid var(--bad); }

/* ---- file rows (SAS) ---- */
.files { list-style: none; margin: .5rem 0 0; padding: 0; display: flex;
  flex-direction: column; gap: .6rem; }
.filerow { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap;
  border: 2px solid var(--line); border-radius: .7rem; background: var(--surface-2);
  padding: .65rem .8rem; }
.filerow .fic { flex: none; width: 2.4rem; height: 2.4rem; border-radius: .6rem;
  background: var(--surface); border: 2px solid var(--line); display: grid;
  place-items: center; font-size: 1.15rem; }
.filerow .fm { flex: 1; min-width: 10rem; }
.filerow .fm b { display: block; color: var(--ink); font-size: .95rem; overflow-wrap: anywhere; }
.filerow .fm span { display: block; font-size: .8rem; color: var(--muted); }

/* featured pick (★ Recommended) — the gold frame plus a WORDED tag */
.featured { position: relative; border: 3px solid var(--gold); border-radius: var(--r-md);
  background: var(--surface-2); padding: 1.15rem 1rem .95rem; margin: 1.15rem 0 .4rem; }
.featured .ftag { position: absolute; top: -.85rem; left: .9rem; background: var(--gold);
  color: #3a2c00; font-size: .68rem; font-weight: 800; letter-spacing: .06em;
  text-transform: uppercase; border-radius: var(--r-full); padding: .3em .8em; }
.featured .frow { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; }
.featured .fic { flex: none; width: 2.7rem; height: 2.7rem; border-radius: .7rem;
  background: var(--surface); border: 2px solid var(--line); display: grid;
  place-items: center; font-size: 1.35rem; }
.featured .fm { flex: 1; min-width: 10rem; }
.featured .fm b { display: block; color: var(--ink); font-size: 1.05rem; font-family: var(--serif); }
.featured .fm span { display: block; font-size: .85rem; color: var(--muted); }
.featured .btn { margin-top: .85rem; width: 100%; }
.other-h { font-size: .74rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); margin: 1.2rem 0 .4rem; }

/* ---- admin preview banner (Mathematica pattern, adopted everywhere) ---- */
.preview { display: flex; gap: .6rem; align-items: flex-start; background: var(--warn-bg);
  border: 2px solid var(--warn); border-radius: .7rem; padding: .7rem .9rem; margin: 0 0 1rem;
  font-size: .92rem; color: var(--ink); }
.preview b { color: var(--ink); }

/* a button that reads as a link (visible, focusable, no href="#") */
.linklike { background: none; border: none; padding: .2rem .15rem; margin: 0; font: inherit;
  font-weight: 700; color: var(--link); text-decoration: underline;
  text-underline-offset: .15em; cursor: pointer; }

/* ---- admin type-ahead search ---- */
.asearch { border: 2px solid var(--line); border-radius: var(--r-md); background: var(--surface-2);
  padding: .8rem .9rem; margin: 0 0 1.1rem; }
.asearch label { display: block; font-size: .76rem; font-weight: 800; letter-spacing: .05em;
  text-transform: uppercase; color: var(--muted); margin: 0 0 .45rem; }
.asearch input { width: 100%; font: inherit; color: var(--ink); background: var(--surface);
  border: 2px solid var(--line); border-radius: .55rem; padding: .6rem .75rem; min-height: 2.85rem; }
.ares { margin-top: .6rem; display: flex; flex-direction: column; gap: .45rem;
  max-height: 20rem; overflow-y: auto; }
.asrow { display: flex; flex-direction: column; gap: .1rem; text-align: left; width: 100%;
  cursor: pointer; border: 2px solid var(--line); border-radius: .6rem; background: var(--surface);
  color: var(--ink); font: inherit; padding: .6rem .8rem; min-height: 2.85rem; }
.asrow:hover { border-color: var(--blue); }
.asrow .asn { font-weight: 700; }
.asrow .asu { font-size: .8rem; color: var(--muted); font-family: var(--mono); }
.asmuted { font-size: .88rem; color: var(--muted); margin: .3rem 0 0; }

/* ---- saved Host-ID list (MNova) ---- */
.savedlist { list-style: none; margin: .6rem 0 0; padding: 0; display: flex;
  flex-direction: column; gap: .4rem; }
.savedlist li { font-family: var(--mono); font-size: .9rem; color: var(--ink);
  background: var(--surface-2); border: 2px solid var(--line); border-radius: .55rem;
  padding: .5rem .7rem; overflow-wrap: anywhere; }

/* inline validation error — ALWAYS in the DOM so role=alert announces on insert */
.gerr { display: block; min-height: 0; margin: .35rem 0 0; font-size: .88rem; font-weight: 700;
  color: var(--bad); }
.gerr:empty { margin: 0; }
.field.invalid textarea, .field.invalid input { border-color: var(--bad); }

/* ---- loading state ---- */
.gcenter { text-align: center; color: var(--muted); padding: 1.2rem 0; }
.gcenter p { margin: .8rem 0 0; }
.gspin { display: inline-block; width: 2.1rem; height: 2.1rem; border: 3px solid var(--line);
  border-top-color: var(--blue); border-radius: 50%; animation: gspin .8s linear infinite; }
@keyframes gspin { to { transform: rotate(360deg); } }

/* ---- action row (Save as PDF etc.) ---- */
.gate-actions { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: 1.2rem; }

/* ---- re-auth escape hatch: a proper, visible block, not fine print ---- */
.reauth { margin-top: 1.4rem; padding-top: 1rem; border-top: 2px solid var(--line); }
.reauth p { margin: .2rem 0 .55rem; font-size: .92rem; }
.reauth .reauth-fine { font-size: .85rem; color: var(--muted); margin-top: .6rem; }

/* ---- inline keyboard/product tokens ---- */
.kbd { font-family: var(--mono); font-size: .88em; background: var(--surface-2);
  border: 1px solid var(--line); border-radius: .3rem; padding: .05em .4em; color: var(--ink); }

/* ---- KB (getting-started) pages ---- */
.kb section { margin: 0 0 1.6rem; }
.kb h2 { font-size: 1.25rem; margin: 2rem 0 .5rem; letter-spacing: -.01em; color: var(--ink); }
.kb h3 { font-size: 1.02rem; margin: 1.2rem 0 .4rem; color: var(--ink); }
.kb .callout p { margin: .3rem 0 0; }
.gsteps { counter-reset: s; list-style: none; margin: 1rem 0; padding: 0; }
.gsteps > li { counter-increment: s; position: relative; padding: .1rem 0 .1rem 3rem;
  margin: 0 0 .95rem; min-height: 2.1rem; }
.gsteps > li::before { content: counter(s); position: absolute; left: 0; top: 0;
  width: 2.1rem; height: 2.1rem; border-radius: 50%; background: var(--blue); color: #fff;
  display: grid; place-items: center; font-weight: 800; font-size: .92rem;
  font-variant-numeric: tabular-nums; }
/* dark-mode --blue is light — flip the number to navy ink (same logic as .btn.navy) */
:root[data-theme="dark"] .gsteps > li::before,
:root:not([data-theme="light"]) .gsteps > li::before { color: #04283f; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .gsteps > li::before { color: #fff; }
}
:root[data-theme="light"] .gsteps > li::before { color: #fff; }
.gsteps ol.sub { list-style: lower-alpha; margin: .5rem 0 0; padding-left: 1.4rem;
  color: var(--muted); }
.gsteps ol.sub li { margin: .3rem 0; }
ul.dash { list-style: none; padding-left: .2rem; margin: .9rem 0; }
ul.dash li { position: relative; padding-left: 1.25rem; margin: .45rem 0; }
ul.dash li::before { content: ""; position: absolute; left: .1rem; top: .72em; width: .55rem;
  height: 3px; background: var(--gold-deep); }

/* big student CTA (e.g. "Get your activation keys →") */
.kb-cta { margin: 1.1rem 0; }
.kb-cta .btn { font-size: 1.02rem; }

/* ---- print: keys/files pages print clean (Save-as-PDF friendly) ---- */
@media print {
  .gate-wrap, .kb-wrap { max-width: none; }
  .gcard { box-shadow: none; border-color: #000; margin: 0; }
  .gtop { background: #fff !important; color: #000; border-bottom: 4px solid #b08900; }
  .gtop h1 { color: #000; }
  .gtop .eyebrow, .gtop .gsub { color: #333; }
  .preview, .asearch, .reauth, .gate-actions, .cpall, .linklike, .gspin { display: none !important; }
  .keyrow, .filerow, .featured, .savedlist li { break-inside: avoid; border-color: #000;
    background: #fff; }
  .kv, .savedlist li { color: #000; }
  .gsteps > li { break-inside: avoid; }
  .gsteps > li::before { background: #fff; color: #000 !important; border: 2px solid #000; }
  .callout { break-inside: avoid; }
  a { color: #000; text-decoration: underline; }
}

/* ============================================================
   KB "three moves" layout — the redesigned short-form guides.
   One slim hero, three numbered move cards (key -> download ->
   install), accordions for the long tail. Uniform on all pages.
   ============================================================ */
.kb2-hero { display: flex; align-items: center; gap: .9rem; flex-wrap: wrap;
  background: var(--hero-grad); color: #fff; border-radius: var(--r-lg);
  border-bottom: 4px solid var(--gold); padding: 1rem 1.2rem; margin: 1rem 0 1.1rem; }
.kb2-hero .tile { width: 3.2rem; height: 3.2rem; font-size: 1.5rem; flex: none;
  border: 2px solid rgba(255,255,255,.35); border-radius: .7rem;
  display: flex; align-items: center; justify-content: center; }
.kb2-hero h1 { margin: 0; font-family: var(--serif); font-weight: 600; color: #fff;
  font-size: clamp(1.25rem, 4vw, 1.6rem); line-height: 1.15; }
.kb2-hero .sub { margin: .2rem 0 0; color: #d7e6f2; font-size: .9rem; }
.kb2-hero .pill { border: 2px solid rgba(255,255,255,.5); background: rgba(255,255,255,.12);
  color: #fff; margin-top: .45rem; }

/* the three moves */
.moves { display: grid; grid-template-columns: 1fr; gap: .8rem; margin: 0 0 1.1rem;
  padding: 0; list-style: none; counter-reset: move; }
@media (min-width: 46rem) { .moves { grid-template-columns: repeat(3, 1fr); } }
.move { background: var(--surface); border: 2px solid var(--line); border-radius: var(--r-md);
  padding: .95rem 1rem 1.05rem; display: flex; flex-direction: column; gap: .5rem;
  counter-increment: move; }
.move > h2 { display: flex; align-items: center; gap: .55rem; margin: 0;
  font-size: 1rem; color: var(--ink); }
.move > h2::before { content: counter(move); flex: none; width: 1.75rem; height: 1.75rem;
  border-radius: 50%; background: var(--blue); color: #fff; font-weight: 800;
  font-size: .95rem; display: inline-flex; align-items: center; justify-content: center; }
:root[data-theme="dark"] .move > h2::before { color: #04283f; }
.move p { margin: 0; font-size: .89rem; color: var(--body); }
.move .btn { margin-top: auto; width: 100%; }
.move .btn + .btn { margin-top: .45rem; }
.move .fine { margin: 0; }

/* download buttons + rendered link lists.
   Download buttons keep the charter's 44px target but sit at their natural width
   instead of stretching into a full-card slab (they read as chunky at card width). */
.btn.dl { width: auto; align-self: flex-start; padding: .55rem .95rem; font-size: .88rem; }
.move .btn.dl { width: auto; margin-top: .1rem; }
.move .btn.dl + .btn.dl { margin-top: .4rem; }
.size-chip { font-size: .68rem; font-weight: 600; background: rgba(255,255,255,.2);
  border: 1px solid rgba(255,255,255,.36); border-radius: var(--r-full);
  padding: .06rem .42rem; margin-left: .3rem; }
.btn.plain .size-chip { background: var(--surface-2); border-color: var(--line);
  color: var(--muted); }
.dl-files { display: flex; flex-direction: column; align-items: flex-start;
  gap: .45rem; margin-top: .5rem; }
/* a serial / license code shown for the reader to copy */
.serial { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin: 0; }
.serial .code { font-family: var(--mono); font-size: 1.02rem; font-weight: 700;
  letter-spacing: .04em; color: var(--ink); background: var(--surface-2);
  border: 2px solid var(--line); border-radius: var(--r-sm); padding: .35rem .6rem;
  user-select: all; }
.gspin.sm { width: 1rem; height: 1rem; border-width: 2px; }

/* the long tail: accordions */
details.more { border: 2px solid var(--line); border-radius: var(--r-md);
  background: var(--surface); margin: .7rem 0; }
details.more > summary { list-style: none; cursor: pointer; display: flex; align-items: center;
  gap: .6rem; padding: .85rem 1rem; font-weight: 700; color: var(--ink);
  font-size: .95rem; min-height: 2.75rem; border-radius: var(--r-md); }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::before { content: "▸"; color: var(--gold-deep); font-size: 1rem;
  transition: transform .15s; }
details.more[open] > summary::before { transform: rotate(90deg); }
@media (prefers-reduced-motion: reduce) { details.more > summary::before { transition: none; } }
details.more > summary:hover, details.more > summary:focus-visible { background: var(--surface-2); }
details.more > .more-body { padding: 0 1rem 1rem; }
details.more > .more-body > :first-child { margin-top: .2rem; }

@media print {
  .kb2-hero { background: #fff !important; color: #000; border: 2px solid #000; }
  .kb2-hero h1 { color: #000; } .kb2-hero .sub { color: #333; }
  details.more { break-inside: avoid; }
  details.more > summary::before { content: ""; }
}
