/* ============================================================
   Billing pages: welcome.html (key handover) and account.html.
   Same "bulletin" identity as index.html: white ground, serif
   thesis, hairline grid, ultramarine ink, square edges, no
   shadows. The tokens and the masthead/footer rules are copied
   from index.html deliberately rather than extracted from it,
   because that file is the live front page and editing its
   <style> to serve two new pages would put it at risk for no
   gain. If the palette there ever changes, change it here too.
   ============================================================ */
:root {
  --white:  #ffffff;
  --ink:    #17181a;
  --grey:   #6e7278;
  --faint:  #898e94;
  --hair:   #dcdee1;
  --ultra:  #23348c;
  --ultra-l:#3a4dbd;
  --warn:   #8c2323;   /* same hue rotated: for "shown once" notices */
  --font-serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --font-sans:  "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-mono:  ui-monospace, "SF Mono", "Cascadia Code", "JetBrains Mono", Consolas, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 112.5%; }
body {
  font-family: var(--font-sans);
  background: var(--white);
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
::selection { background: rgba(35, 52, 140, 0.15); }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 1.5rem; }
/* Text column inside the full-width wrap: the page keeps one left
   edge, shared with the masthead and the footer. */
.col { max-width: 46rem; }
a { color: var(--ultra); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--ultra); outline-offset: 3px; }

.label {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--grey);
}
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* ---- masthead: thick-thin double rule ---- */
.masthead { padding: 1.6rem 0 1rem; }
.masthead-row {
  display: flex; flex-wrap: wrap; align-items: baseline;
  justify-content: space-between; gap: 0.5rem 2rem;
}
.wordmark {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--ink);
}
.wordmark .by {
  font-style: italic; font-weight: 400; font-size: 0.85rem;
  color: var(--grey); margin-left: 0.4rem;
}
.masthead-row .label:last-child { margin-left: auto; }
.masthead .label a { color: var(--grey); }
.masthead .label a:hover { color: var(--ultra); text-decoration: none; }
.masthead .label b { color: var(--ultra); font-weight: 600; }
.rule-thick { border: 0; border-top: 3px solid var(--ink); margin-top: 0.9rem; }
.rule-thin  { border: 0; border-top: 1px solid var(--ink); margin-top: 3px; }

/* ---- page scaffolding ---- */
main { padding: 3.5rem 0 4.5rem; }
h1 {
  font-family: var(--font-serif);
  font-size: clamp(1.9rem, 3.4vw, 2.7rem);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -0.015em;
}
h1 em { font-style: italic; color: var(--ultra); }
h2 {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 500;
  letter-spacing: -0.01em;
}
.lede { margin-top: 1.1rem; color: var(--grey); max-width: 58ch; }
p + p { margin-top: 0.9rem; }
.block { border-top: 1px solid var(--hair); margin-top: 2.8rem; padding-top: 1.8rem; }
.block > .label + * { margin-top: 0.9rem; }
.note { font-size: 0.9rem; color: var(--grey); max-width: 62ch; }
.note b { color: var(--ink); font-weight: 600; }

/* ---- buttons, in the front page's square idiom ---- */
.btn, button.btn {
  display: inline-block;
  background: var(--ultra);
  color: #fff;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.9rem 1.8rem;
  border: 0;
  cursor: pointer;
  transition: background 0.15s ease;
}
.btn:hover:not(:disabled) { background: var(--ultra-l); color: #fff; text-decoration: none; }
.btn:disabled { background: var(--faint); cursor: default; }
.btn.btn-quiet, button.btn.btn-quiet {
  background: none;
  color: var(--ultra);
  border: 1px solid var(--ultra);
  padding: 0.75rem 1.3rem;
  font-size: 0.78rem;
}
.btn.btn-quiet:hover:not(:disabled) { background: var(--ultra); color: #fff; }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.8rem; align-items: center; margin-top: 1.4rem; }

/* ---- forms: hairline fields, no rounding ---- */
label.field { display: block; margin-top: 1.2rem; }
label.field .label { display: block; margin-bottom: 0.4rem; }
input[type="email"], select {
  font-family: var(--font-sans);
  font-size: 1rem;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--ink);
  border-radius: 0;
  padding: 0.7rem 0.8rem;
  width: 100%;
  max-width: 24rem;
}
select { max-width: 12rem; }

/* ---- the key, shown once ---- */
.key-box {
  border: 1px solid var(--ultra);
  border-left-width: 3px;
  padding: 1.1rem 1.2rem;
  margin-top: 1.1rem;
  background: rgba(35, 52, 140, 0.03);
}
.key-value {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  word-break: break-all;
  user-select: all;
  color: var(--ink);
}
.key-once {
  font-size: 0.85rem;
  color: var(--warn);
  font-weight: 600;
  margin-top: 0.9rem;
}

/* ---- key table, matching .plans-table ---- */
.keys-table { width: 100%; border-collapse: collapse; border-top: 3px solid var(--ink); }
.keys-table th {
  font-size: 0.68rem; font-weight: 600;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--grey); text-align: left;
  padding: 0.8rem 1rem 0.8rem 0;
  border-bottom: 1px solid var(--ink);
}
.keys-table td {
  padding: 1.05rem 1rem 1.05rem 0;
  border-bottom: 1px solid var(--hair);
  vertical-align: baseline;
  font-size: 0.93rem;
}
.keys-table td.prefix { font-family: var(--font-mono); white-space: nowrap; }
.keys-table th.period, .keys-table td.period { white-space: nowrap; }
.keys-table td.plan { font-family: var(--font-serif); font-size: 1.05rem; }
.keys-table td.act { text-align: right; white-space: nowrap; }
.keys-table tr.dead td { color: var(--faint); }
.state { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; }
.state.live { color: var(--ultra); }
.state.held { color: var(--warn); }
.state.gone { color: var(--faint); }

/* ---- messages ---- */
.msg { margin-top: 1.4rem; padding: 0.9rem 1.1rem; border-left: 3px solid var(--hair); font-size: 0.93rem; }
.msg.ok { border-left-color: var(--ultra); }
.msg.bad { border-left-color: var(--warn); color: var(--warn); }
.msg[hidden] { display: none; }
.spin::after {
  content: "";
  display: inline-block;
  width: 0.55rem; height: 0.55rem;
  margin-left: 0.5rem;
  border: 1px solid var(--ultra);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin::after { animation: none; } }

/* ---- footer colophon ---- */
footer { padding: 0 0 3rem; }
footer .rule-thick { margin-top: 0; }
.colophon {
  display: flex; flex-wrap: wrap; justify-content: space-between;
  gap: 0.6rem 2rem; padding-top: 0.9rem;
  font-size: 0.82rem; color: var(--faint);
}

@media (max-width: 720px) {
  .keys-table td.period, .keys-table th.period { display: none; }
  .btn, button.btn { width: 100%; text-align: center; }
  .btn.btn-quiet { width: auto; }
}

/* On a phone the key table's own minimum width (a monospace prefix, a state
   sentence and a button in one row) is about 500px, which overflowed the
   viewport and gave the page a horizontal scroll. Below that, each key becomes
   a stacked block separated by the same hairline, rather than a table trying
   to be four columns wide. */
@media (max-width: 620px) {
  .keys-table { border-top-width: 3px; }
  .keys-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .keys-table, .keys-table tbody, .keys-table tr, .keys-table td { display: block; width: 100%; }
  .keys-table tr { border-bottom: 1px solid var(--hair); padding: 1.1rem 0; }
  .keys-table td { border: 0; padding: 0.1rem 0; }
  .keys-table td.prefix { white-space: normal; word-break: break-all; }
  .keys-table td.plan { font-size: 1.1rem; }
  .keys-table td.act { text-align: left; margin-top: 0.8rem; }
}
