/* ============================================================
   TraceWire — app layer over the marketing "Blueprint" stylesheet.

   /theme/styles.css is a byte-for-byte mirror of
   https://gettracewire.com/styles.css (provenance in MIRROR, kept honest by
   deploy/tw-theme-mirror). It owns every token, the graph-paper grid, the
   nav, the buttons and the footer. This file adds only what a form-driven
   page needs and the marketing site does not have: panels, inputs,
   validation and status colours, and a few layout pieces.

   It defines NO colours, fonts or radii of its own — every value below is
   one of styles.css's tokens — so marketing and app cannot drift apart by
   construction. Status colours are the two working accents the design
   system already has: fiber green for "good", safety orange for "needs
   attention". Loaded after styles.css on every page under
   app.gettracewire.com and by the router's error pages.
   ============================================================ */

/* ---------- Page frame ---------- */
body { display: flex; flex-direction: column; min-height: 100vh; }
main, .center-stage, .tiers { flex: 1 0 auto; }
[hidden] { display: none !important; }
.mono, code { font-family: var(--font-mono); }
code { font-size: 0.92em; color: var(--line-bright); }

/* Text links inside content. styles.css makes every <a> inherit its colour
   (right for the nav); inside copy a link has to look like one. */
.panel a:not(.btn), .text a, footer a, .linkbtn {
  color: var(--line-bright); text-decoration: underline; text-underline-offset: 2px;
}
.linkbtn { background: none; border: 0; padding: 0; font: inherit; font-size: 13.5px; cursor: pointer; }

/* Buttons: styles.css has .btn/.btn-primary/.btn-ghost/.btn-sm. Forms want
   a full-width one, and two pages inject "btn ghost" (space) from script. */
.btn-block { width: 100%; justify-content: center; }
.btn.ghost { border-color: var(--line); color: var(--ink); background: transparent; }
.btn.ghost:hover { border-color: var(--line-bright); color: var(--line-bright); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary:disabled:hover { background: var(--safety-orange); }

/* A single centred panel (verify, billing, login cases, portal sign-in). */
.center-stage {
  display: flex; align-items: center; justify-content: center;
  padding: 40px 24px; width: 100%;
}
.center-stage > .panel { width: 100%; max-width: 520px; }
.center-stage > .panel.narrow { max-width: 400px; }

/* ---------- Panel — the drawing-panel idiom, not a rounded SaaS card ---------- */
.panel {
  border: 1px solid var(--line);
  background: var(--bg-raised);
  border-radius: var(--radius);
  padding: 28px;
}
.panel + .panel { margin-top: 16px; }
.panel.featured { border-color: var(--line-bright); }
.panel h1 {
  font-family: var(--font-display); font-weight: 700;
  font-size: 30px; line-height: 1.05; letter-spacing: 0.005em; margin: 0 0 8px;
}
.panel h2 {
  font-family: var(--font-display); font-weight: 700;
  font-size: 24px; line-height: 1.1; margin: 0 0 6px;
}
.panel h2.small { font-family: var(--font-body); font-size: 15px; font-weight: 600; margin: 0 0 4px; }
.panel .lede, .panel .sub { color: var(--ink-dim); font-size: 15px; margin: 0 0 18px; }
.panel .hint-p { color: var(--ink-faint); font-size: 13px; margin: 0 0 16px; }
.eyebrow {
  font-family: var(--font-mono); font-size: 11.5px; font-weight: 500;
  letter-spacing: .08em; text-transform: uppercase; color: var(--line-bright);
  margin-bottom: 10px;
}
.points { list-style: none; padding: 0; margin: 0 0 20px; }
.points li { color: var(--ink-dim); font-size: 14px; padding-left: 18px; position: relative; margin-bottom: 6px; }
.points li::before {
  content: ""; position: absolute; left: 2px; top: 9px;
  width: 6px; height: 6px; border-radius: 1px; background: var(--fiber-green);
}
.divider { border: 0; border-top: 1px solid var(--line-dim); margin: 22px 0; }

/* Page heading above the panels (signup). styles.css's .page-hero is the
   marketing interior-page heading; this only trims its top padding. */
.page-hero { padding-top: 48px; }

/* ---------- Forms ---------- */
label { display: block; font-size: 13px; font-weight: 500; color: var(--ink-dim); margin-bottom: 6px; }
label .opt { color: var(--ink-faint); font-weight: 400; }
input[type="text"], input[type="email"], input[type="password"], input[type="tel"], select {
  width: 100%; padding: 10px 12px; margin: 0;
  background: var(--bg); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--radius);
  font-family: var(--font-body); font-size: 15px; line-height: 1.4;
}
input::placeholder { color: var(--ink-faint); }
input:focus-visible, select:focus-visible, .btn:focus-visible, .linkbtn:focus-visible {
  outline: 1px solid var(--line-bright); outline-offset: 1px; border-color: var(--line-bright);
}
input[aria-invalid="true"] { border-color: var(--safety-orange-bright); }
.field { margin-bottom: 14px; }
.field-err { color: var(--safety-orange-bright); font-size: 13px; min-height: 17px; margin-top: 4px; }
.row { display: flex; gap: 12px; } .row > * { flex: 1; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.note { color: var(--ink-faint); font-size: 12.5px; margin: 10px 0 0; text-align: center; }
.muted { color: var(--ink-faint); font-size: 12.5px; margin-top: 14px; }

/* Subdomain as one continuous address: input + fixed suffix. */
.sub-row { display: flex; align-items: stretch; }
.sub-row input {
  border-top-right-radius: 0; border-bottom-right-radius: 0;
  font-family: var(--font-mono); text-align: right;
}
.suffix {
  display: flex; align-items: center; padding: 0 12px; white-space: nowrap;
  background: var(--bg-raised-2); border: 1px solid var(--line); border-left: 0;
  border-top-right-radius: var(--radius); border-bottom-right-radius: var(--radius);
  color: var(--ink-dim); font-family: var(--font-mono); font-size: 13.5px;
}

/* ---------- Status language: green is good, orange needs attention ---------- */
.hint { font-size: 13px; min-height: 17px; margin-top: 4px; color: var(--ink-faint); }
.hint.ok   { color: var(--fiber-green); }
.hint.bad  { color: var(--safety-orange-bright); }
.hint.busy { color: var(--ink-faint); }

.msg { font-size: 13.5px; min-height: 1.2em; margin: 10px 0 0; }
.msg.ok  { color: var(--fiber-green); }
.msg.err { color: var(--safety-orange-bright); }

.banner, .result, .notice {
  padding: 13px 15px; border: 1px solid var(--line); border-radius: var(--radius);
  font-size: 14px; background: var(--bg-raised-2); margin-bottom: 16px;
}
.result { margin: 14px 0 0; }
.result strong { display: block; margin-bottom: 3px; }
.banner.ok, .result.ok {
  color: var(--fiber-green); border-color: var(--fiber-green);
  background: color-mix(in srgb, var(--fiber-green) 10%, transparent);
}
.banner.err, .result.err, .notice.bad {
  color: var(--safety-orange-bright); border-color: var(--safety-orange);
  background: color-mix(in srgb, var(--safety-orange) 10%, transparent);
}
.banner.warn, .notice.warn {
  color: var(--safety-orange-bright); border-color: var(--safety-orange);
  background: color-mix(in srgb, var(--safety-orange) 6%, transparent);
}
.notice strong { color: var(--ink); }

.pill {
  display: inline-block; padding: 2px 8px; border: 1px solid; border-radius: var(--radius);
  font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: .05em;
}
.pill.ok   { color: var(--fiber-green); border-color: var(--fiber-green); }
.pill.warn { color: var(--safety-orange-bright); border-color: var(--safety-orange); }
.pill.bad  { color: var(--safety-orange-bright); border-color: var(--safety-orange-bright); }
.pill.mute { color: var(--ink-faint); border-color: var(--line-dim); }

/* ---------- Signup: two peer tiers, and the trace animation ---------- */
.tiers {
  display: grid; grid-template-columns: 1fr 1fr; gap: 20px;
  max-width: 940px; margin: 30px auto 0; padding: 0 24px 64px; align-items: start;
}
@media (max-width: 800px) { .tiers { grid-template-columns: 1fr; } }
.existing-customer { text-align: center; font-size: 13.5px; margin: 22px 0 0; color: var(--ink-dim); }

/* Same dashed-path-then-lit idea as the marketing hero, in linework colours. */
.trace-stage { max-width: 760px; margin: 22px auto 0; }
.trace-svg { width: 100%; height: 52px; display: block; }
.trace-path { fill: none; stroke: var(--line-dim); stroke-width: 1.5; stroke-dasharray: 6 6; }
.trace-path-lit {
  fill: none; stroke: var(--line-bright); stroke-width: 2;
  stroke-dasharray: 900; stroke-dashoffset: 900; animation: draw 2.6s ease-out forwards;
}
@keyframes draw { to { stroke-dashoffset: 0; } }
.trace-node { fill: var(--safety-orange); opacity: 0; animation: node .4s ease-out 2.2s forwards; }
@keyframes node { to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .trace-path-lit { animation: none; stroke-dashoffset: 0; }
  .trace-node { animation: none; opacity: 1; }
}

/* ---------- Billing: order summary, terms, consent ---------- */
.summary {
  background: var(--bg-raised-2); border: 1px solid var(--line-dim); border-radius: var(--radius);
  padding: 14px 16px; margin-bottom: 20px; font-size: 14px;
}
.summary div { display: flex; justify-content: space-between; padding: 3px 0; }
.summary .k { color: var(--ink-dim); }
.summary .v { font-family: var(--font-mono); font-size: 13px; }
.price { font-size: 19px; font-weight: 700; color: var(--ink); }
.terms {
  background: var(--bg-raised-2); border: 1px solid var(--line-dim); border-radius: var(--radius);
  padding: 14px 16px; margin-bottom: 20px;
}
.terms h2 {
  margin: 0 0 9px; font-family: var(--font-mono); font-size: 11.5px; font-weight: 500;
  letter-spacing: .08em; text-transform: uppercase; color: var(--line-bright);
}
.terms ul { margin: 0; padding-left: 17px; font-size: 13.5px; color: var(--ink-dim); }
.terms li { margin: 5px 0; }
.terms strong { color: var(--ink); font-weight: 600; }
.consent {
  display: flex; gap: 10px; align-items: flex-start; margin: 0 0 16px;
  font-size: 13.5px; font-weight: 400; line-height: 1.45; color: var(--ink); cursor: pointer;
}
.consent input { width: 17px; height: 17px; flex: 0 0 auto; margin: 1px 0 0; accent-color: var(--safety-orange); cursor: pointer; }

/* ---------- Portal: the signed-in account view ---------- */
.nav-who { display: flex; align-items: center; gap: 14px; color: var(--ink-dim); font-size: 13.5px; }
.portal-main { width: 100%; max-width: 900px; margin: 0 auto; padding: 28px 28px 60px; }
.portal-main h2 {
  font-family: var(--font-mono); font-size: 12px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--ink-faint); font-weight: 500; margin: 0 0 14px;
}
.service {
  border: 1px solid var(--line); background: var(--bg-raised); border-radius: var(--radius);
  padding: 20px; margin-bottom: 14px;
}
.service .row1 { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.service .name { font-family: var(--font-display); font-size: 22px; font-weight: 700; }
.service .plan { color: var(--ink-faint); font-size: 12.5px; }
.service .host { font-family: var(--font-mono); font-size: 12.5px; color: var(--ink-dim); margin-top: 4px; word-break: break-all; }
.facts {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px;
  margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line-dim);
}
.facts .k { font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-faint); }
.facts .v { margin-top: 3px; font-size: 13.5px; }
.actions { margin-top: 18px; display: flex; gap: 10px; flex-wrap: wrap; }
.empty { color: var(--ink-dim); font-size: 14px; }

/* ---------- Router error pages ---------- */
.panel.center { text-align: center; max-width: 460px; }
.panel.center .logo-mark { width: 30px; height: 30px; margin-bottom: 12px; }
.panel.center p { color: var(--ink-dim); margin: 0 0 20px; }

/* ---------- A narrow column of stacked panels (login, set-password) ---------- */
.center-stage > .col { width: 100%; max-width: 460px; }
.col > h1 { font-family: var(--font-display); font-weight: 700; font-size: 34px; line-height: 1.05; margin: 0 0 8px; }
.col > .lede { color: var(--ink-dim); font-size: 15px; margin: 0 0 24px; }
.newbie { text-align: center; color: var(--ink-dim); font-size: 13.5px; padding: 18px 0 0; }
.newbie a { color: var(--line-bright); text-decoration: underline; text-underline-offset: 2px; }
