/* ==========================================================================
   MathClash — standalone pages (terms, forgot / reset password)
   Same tokens as landing-v3.css (the app's Flexoki: ink by default, paper
   when bright mode was picked), kept tiny so these pages stay light.
   No third-party requests (CSP).
   ========================================================================== */
@font-face {
  font-family: "Geist";
  src: url("/assets/fonts/geist-variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
:root {
  --ink: #100f0f;
  --g2: #1c1b1a;
  --g3: #282726;
  --line: #282726;
  --line-2: #343331;
  --line-3: #403e3c;
  --field: #6f6e69;  /* text-field edge, 3:1 (WCAG 1.4.11) */
  --t1: #fffcf0;
  --t2: #cecdc3;
  --t3: #878580;
  --acc: #da702c;
  --acc-hi: #ec8b49;
  --acc-rgb: 218, 112, 44;
  --red-text: #e8705f;
  --hl: rgba(255, 252, 240, 0.07);
  --drop: rgba(0, 0, 0, 0.8);
  --key: 1;
  --ease: cubic-bezier(0.23, 1, 0.32, 1);
  --font: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}
/* bright mode, picked on the landing or in the app (theme-boot.js sets the attribute) */
:root[data-mc-theme="light"] {
  --ink: #fffcf0;
  --g2: #fffcf0;
  --g3: #f2f0e5;
  --line: #e6e4d9;
  --line-2: #dad8ce;
  --line-3: #cecdc3;
  --field: #878580;
  --t1: #100f0f;
  --t2: #403e3c;
  --t3: #66655f;
  --acc: #b44f14;
  --acc-hi: #9d4310;
  --acc-rgb: 180, 79, 20;
  --red-text: #942822;
  --hl: rgba(255, 255, 255, 0);
  --drop: rgba(16, 15, 15, 0.2);
  --key: 0.5;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { background: var(--ink); scrollbar-color: var(--line-3) var(--ink); }
body {
  margin: 0;
  min-height: 100vh;
  padding: 28px 16px 64px;
  background: radial-gradient(60% 420px at 50% 0%, rgba(var(--acc-rgb), calc(0.07 * var(--key))), transparent 70%) no-repeat, var(--ink);
  color: var(--t1);
  font: 400 17px/1.5 var(--font);
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
::selection { background: var(--acc); color: var(--ink); }
:focus-visible { outline: 2px solid var(--acc); outline-offset: 3px; border-radius: 8px; }

.page { width: min(440px, 100%); margin: clamp(8px, 8vh, 96px) auto 0; }
.page-wide { width: min(720px, 100%); margin-top: 8px; }
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  margin-bottom: 24px;
  color: var(--t1);
  font: 650 1.3125rem/1 var(--font);
  letter-spacing: -0.025em;
  text-decoration: none;
}
/* the mark's inline colours are the old palette's: ink T, orange bolt (#da702c, as in the app) */
.brand svg path:first-child { stroke: var(--t1); }
.brand svg path:last-child { fill: #da702c; }
.card {
  padding: clamp(26px, 5vw, 40px);
  border-radius: 28px;
  border: 1px solid var(--line-2);
  background: linear-gradient(180deg, var(--hl), transparent 30%), var(--g2);
  box-shadow: inset 0 1px 0 var(--hl), 0 40px 90px -30px var(--drop);
}
h1 { margin: 0 0 8px; font: 650 1.75rem/1.1 var(--font); letter-spacing: -0.03em; text-wrap: balance; }
.sub { margin: 0 0 24px; color: var(--t3); font-size: 0.9375rem; }

.field { margin-bottom: 18px; }
label { display: block; margin-bottom: 8px; color: var(--t2); font: 500 0.9375rem/1.3 var(--font); }
input {
  width: 100%;
  min-height: 52px;
  padding: 0 16px;
  border-radius: 12px;
  border: 1px solid var(--field);
  background: var(--ink);
  color: var(--t1);
  font: 500 1.0625rem/1 var(--font);
  letter-spacing: -0.01em;
  caret-color: var(--acc);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
input::placeholder { color: var(--t3); }
/* show / hide password (pw-toggle.js); anchored to the field's bottom here */
.field { position: relative; }
.field input[data-mc-pw] { padding-right: 52px; }
.mc-pw-toggle {
  position: absolute;
  right: 4px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: none;
  color: var(--t3);
  cursor: pointer;
}
.mc-pw-toggle:hover, .mc-pw-toggle[aria-pressed="true"] { color: var(--t1); }
.field .mc-pw-toggle { top: auto !important; bottom: 4px; }
input:hover { border-color: var(--t3); }
input:focus { border-color: var(--acc); box-shadow: 0 0 0 4px rgba(var(--acc-rgb), 0.18); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 52px;
  margin-top: 8px;
  padding: 0 24px;
  border: 0;
  border-radius: 999px;
  background: var(--acc);
  color: var(--ink);
  font: 600 1.0625rem/1 var(--font);
  letter-spacing: -0.01em;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.16s var(--ease);
}
.btn:hover { background: var(--acc-hi); }
.btn:active { transform: scale(0.97); }
.btn:disabled { background: var(--g3); color: var(--t3); cursor: not-allowed; transform: none; }

.msg { margin-top: 14px; font-size: 0.9375rem; line-height: 1.5; }
.msg:empty { display: none; }
.msg.ok { color: var(--acc); }
.msg.err { color: var(--red-text); }
.wait { margin: 0; color: var(--t3); font-size: 0.9375rem; }

.back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  margin-top: 14px;
  color: var(--t2);
  font-size: 0.9375rem;
  text-decoration: none;
}
.back:hover { color: var(--t1); }
.back svg { transition: transform 0.25s var(--ease); }
@media (hover: hover) and (pointer: fine) { .back:hover svg { transform: translateX(-3px); } }

/* terms */
.legal h1 { font-size: clamp(2rem, 5vw, 2.75rem); letter-spacing: -0.035em; }
.legal h2 { margin: 30px 0 6px; font: 600 1.0625rem/1.3 var(--font); letter-spacing: -0.015em; color: var(--t1); }
.legal p { margin: 0 0 10px; max-width: 60ch; color: var(--t2); font-size: 1rem; line-height: 1.6; text-wrap: pretty; }
.legal p a { color: var(--acc); text-underline-offset: 3px; }
.legal ul { margin: 0 0 10px; padding-left: 1.2em; color: var(--t2); line-height: 1.6; }
.legal li a { color: var(--acc); text-underline-offset: 3px; }
.legal code { font-size: 0.875em; overflow-wrap: anywhere; color: var(--t1); }
.btn-inline { width: auto; }

/* cookie policy tables: the wrapper scrolls on a narrow phone, never the page */
.table-wrap { overflow-x: auto; margin: 0 0 12px; }
.legal table { width: 100%; min-width: 520px; border-collapse: collapse; color: var(--t2); font-size: 0.875rem; line-height: 1.45; }
.legal th, .legal td { padding: 9px 10px 9px 0; border-bottom: 1px solid var(--line-2); text-align: left; vertical-align: top; }
.legal th { color: var(--t1); font-weight: 600; }

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