/* Proofred web app — the flat surface of the design system.
 *
 * Per the handoff: settings and the dashboard are full Modernist — flat,
 * square, ruled, no glass, no elevation. Radius is 0 everywhere on purpose;
 * the 2px rules and the alignment do the organising. Glass and rounded
 * corners belong only to extension chrome floating over a host page, which is
 * not this.
 *
 * Light only. The design system is a light-ground system and every mockup is
 * built on it; bolting a dark theme onto it would be inventing a half of the
 * system that does not exist.
 */

:root {
  color-scheme: light;

  --ink: #201e1d;
  --ground: #f3f2f2;
  --surface: #eae9e9;
  --red: #e5484d;
  --red-press: #c93b40;

  --muted: rgba(32, 30, 29, 0.55);
  --muted-strong: rgba(32, 30, 29, 0.65);
  --faint: rgba(32, 30, 29, 0.4);
  --hairline: rgba(32, 30, 29, 0.14);
  --divider: rgba(32, 30, 29, 0.4);
  --field-border: rgba(32, 30, 29, 0.3);

  --sans: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.6;
  color: var(--ink);
  background: var(--ground);
  -webkit-font-smoothing: antialiased;
}

.page {
  width: 100%;
  max-width: 620px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* --- wordmark: live type, not an image ---------------------------------- *
 * Set in Archivo per the handoff. The SVG in assets/ hardcodes Avenir Next
 * and falls back to Helvetica anywhere but the machine that drew it.        */

.wordmark {
  font-family: var(--sans);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--ink);
  text-decoration: underline wavy var(--red);
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
  font-size: 22px;
  line-height: 1;
  display: inline-block;
}
.wordmark span { color: var(--red); }
a.wordmark { text-decoration-line: underline; }

/* --- structure ---------------------------------------------------------- */

.head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 26px 28px 18px;
}

/* The strong rule is the system's main organising device. Two pixels, not a
   hairline — softening it is called out as a "don't". */
.rule { height: 2px; background: var(--divider); }
.hair { height: 1px; background: var(--hairline); }

#app { flex: 1; display: flex; flex-direction: column; }
main { padding: 24px 28px 30px; }

.foot {
  border-top: 2px solid var(--divider);
  padding: 14px 28px 22px;
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.6;
  color: var(--muted);
}

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

h1 {
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.025em;
  margin: 0 0 6px;
}

h2 {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 10px;
}

p { margin: 0; }
.sub { color: var(--muted-strong); font-size: 14px; }
.note { font-family: var(--mono); font-size: 11px; color: var(--faint); }

.kicker {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.stack { display: flex; flex-direction: column; }
.gap-sm { gap: 8px; }
.gap-md { gap: 14px; }
.gap-lg { gap: 22px; }

.error {
  border-left: 2px solid var(--red);
  padding-left: 10px;
  font-size: 13.5px;
  color: var(--ink);
}

/* --- form --------------------------------------------------------------- *
 * Input butted directly against its button, no gap and no radius — the
 * dictionary pattern from the settings mock, reused so the two surfaces
 * agree.                                                                    */

.field { display: flex; align-items: stretch; }

input[type="email"] {
  flex: 1;
  min-width: 0;
  font-family: var(--sans);
  font-size: 14px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--field-border);
  border-right: 0;
  border-radius: 0;
  padding: 11px 12px;
}
input[type="email"]::placeholder { color: var(--faint); }
input[type="email"]:disabled { opacity: 0.55; }

.btn {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  text-align: left;          /* flush left, even inside a wide button */
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: 0;
  padding: 12px 18px;
  cursor: pointer;
  display: block;
}

.btn-primary { background: var(--red); color: #fff; border-color: var(--red); }
.btn-primary:hover { background: var(--red-press); border-color: var(--red-press); }
.btn-primary:disabled { opacity: 0.5; cursor: default; }

.btn-secondary { background: transparent; color: var(--ink); border-color: var(--field-border); }
.btn-secondary:hover { background: rgba(229, 72, 77, 0.07); border-color: var(--red); }

.btn-block { width: 100%; }
.btn-attached { flex: 0 0 auto; }

:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
::selection { background: rgba(229, 72, 77, 0.18); }

/* --- rows and stats ----------------------------------------------------- */

.rows { display: flex; flex-direction: column; }

.row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--hairline);
  font-size: 14px;
}
.row:last-child { border-bottom: 0; }
.row-label { color: var(--muted); }
.row-value { font-variant-numeric: tabular-nums; text-align: right; }
.row-value.mono { font-family: var(--mono); font-size: 13px; }

/* The dashboard's stat strip: equal cells, 1px verticals, 2px bottom rule. */
.stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  border-top: 1px solid var(--hairline);
  border-bottom: 2px solid var(--divider);
}
.stat { padding: 18px 20px 18px 0; }
.stat + .stat { border-left: 1px solid var(--hairline); padding-left: 20px; }
.stat-value {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 6px 0 2px;
}
.stat-value .rest { color: var(--faint); }

.state {
  display: inline-block;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 8px;
  background: var(--surface);
  color: var(--muted-strong);
}
.state-on { background: rgba(229, 72, 77, 0.1); color: var(--red); }

@media (max-width: 520px) {
  .head { padding: 20px 18px 14px; }
  main { padding: 20px 18px 24px; }
  .foot { padding: 14px 18px 20px; }
  .stats { grid-template-columns: 1fr; }
  .stat + .stat { border-left: 0; border-top: 1px solid var(--hairline); padding-left: 0; }
  .field { flex-direction: column; }
  input[type="email"] { border-right: 1px solid var(--field-border); border-bottom: 0; }
}
