/* ==========================================================================
   TIEM Instructor Hub
   One family (Archivo, variable width + weight). The discount code is the
   only element set at display size — everything else stays quiet.
   ========================================================================== */

:root {
  --paper:        #FFFFFF;
  --surface:      #F4F4F2;
  --surface-edge: #E6E6E2;
  --ink:          #16181A;
  --muted:        #6E7175;
  --citron:       #CFDE3F;
  --citron-deep:  #94A320;
  --citron-wash:  #F7FAE3;
  --warn:         #A33A22;

  --sans: "Archivo", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --step--1: 0.8125rem;
  --step-0:  1rem;
  --step-1:  1.1875rem;
  --step-2:  1.5rem;
  --step-3:  2rem;
  --step-4:  clamp(2.5rem, 8vw, 3.75rem);

  --gutter: 20px;
  --radius: 10px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--step-0);
  line-height: 1.55;
  font-variation-settings: "wdth" 100;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 660px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.wrap--wide { max-width: 940px; }

/* ---------- type ---------- */

h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; }
h1 { font-size: var(--step-3); }
h2 { font-size: var(--step-2); }
h3 { font-size: var(--step-1); }

p { margin: 0 0 1em; max-width: 62ch; }
p:last-child { margin-bottom: 0; }

a { color: var(--ink); text-decoration-thickness: 1px; text-underline-offset: 3px; }

.lede { font-size: var(--step-1); color: var(--muted); }

.label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  display: block;
}

.fine { font-size: var(--step--1); color: var(--muted); }

/* ---------- masthead ---------- */

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid var(--surface-edge);
  margin-bottom: 32px;
}

.wordmark { display: inline-block; line-height: 0; }
.wordmark img { height: 22px; width: auto; display: block; }

/* The sign-in page gives the logo more room, since there's nothing
   competing with it. */
.signin .wordmark img { height: 26px; }

.masthead nav { display: flex; gap: 18px; align-items: center; font-size: var(--step--1); }

/* ---------- the code card: the one loud thing ---------- */

.codecard {
  background: var(--citron);
  border-radius: var(--radius);
  padding: 22px 22px 20px;
}

.codecard .label { color: var(--citron-deep); }

.code {
  font-size: var(--step-4);
  font-weight: 700;
  font-variation-settings: "wdth" 125;
  letter-spacing: 0.01em;
  line-height: 1;
  margin: 10px 0 8px;
  word-break: break-all;
}

.codecard p { color: #3D4413; margin: 0; font-size: var(--step--1); }

.codecard .actions { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }

/* ---------- stats ---------- */

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 10px 0 0;
}

.stat {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 14px 14px 16px;
}

.stat .n {
  font-size: var(--step-2);
  font-weight: 600;
  line-height: 1.1;
  margin: 6px 0 2px;
  font-variant-numeric: tabular-nums;
}

.stat .sub { font-size: var(--step--1); color: var(--muted); }

/* Pending needs an extra line of explanation, so it gets full width
   below the row rather than being squeezed into a third of it. */
.pending-note {
  margin-top: 10px;
  padding: 12px 14px;
  background: var(--citron-wash);
  border-radius: var(--radius);
  font-size: var(--step--1);
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--ink);
  color: var(--paper);
  font: inherit;
  font-size: var(--step-0);
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: background 120ms ease;
}

.btn:hover { background: #2C3034; }

.btn--citron { background: var(--citron); color: var(--ink); }
.btn--citron:hover { background: #C2D22F; }

.btn--quiet {
  background: var(--paper);
  color: var(--ink);
  border-color: var(--surface-edge);
  padding: 9px 14px;
  font-size: var(--step--1);
}
.btn--quiet:hover { background: var(--surface); }

.btn--block { width: 100%; }

.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

:where(a, button, input, select, textarea):focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

/* ---------- lists ---------- */

.ledger { margin: 10px 0 0; border-top: 1px solid var(--surface-edge); }

.ledger-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 2px;
  border-bottom: 1px solid var(--surface-edge);
  font-size: var(--step--1);
}

.ledger-row .when { color: var(--muted); }
.ledger-row .amt { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ledger-row .amt--down { color: var(--warn); }

/* ---------- forms ---------- */

.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 500; font-size: var(--step--1); margin-bottom: 6px; }

input[type="text"], input[type="email"], input[type="tel"], select, textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--surface-edge);
  border-radius: 8px;
  font: inherit;
  font-size: var(--step-0);
  color: var(--ink);
  background: var(--paper);
}

textarea { min-height: 90px; resize: vertical; }

.hint { font-size: var(--step--1); color: var(--muted); margin-top: 5px; }

/* ---------- messages ---------- */

.note {
  padding: 14px 16px;
  border-radius: var(--radius);
  font-size: var(--step--1);
  margin-bottom: 18px;
}
.note--ok   { background: var(--citron-wash); }
.note--bad  { background: #FBEDE9; color: var(--warn); }
.note[hidden] { display: none; }

/* ---------- sections ---------- */

.section { margin-top: 40px; }
.section > h2 { margin-bottom: 14px; }

.rule { border: 0; border-top: 1px solid var(--surface-edge); margin: 40px 0; }

footer {
  margin: 64px 0 40px;
  padding-top: 20px;
  border-top: 1px solid var(--surface-edge);
  font-size: var(--step--1);
  color: var(--muted);
}

/* ---------- loading ---------- */

.skeleton {
  background: var(--surface);
  border-radius: var(--radius);
  min-height: 120px;
}

/* ---------- responsive ---------- */

@media (min-width: 720px) {
  .stats { gap: 14px; }
  .dash-top { display: grid; grid-template-columns: 1.1fr 1fr; gap: 20px; align-items: start; }
  .dash-top .stats { grid-template-columns: repeat(3, 1fr); margin: 0; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
