/* ============================================================
   ProofingDesk — shared brand tokens (dark edition)
   Used by every user-facing page. Page-specific styles live
   in each page's own <style> block after this file loads.
   ============================================================ */

/* Fonts: loaded once here so every page matches */
@import url("https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,700;0,900;1,400&family=Inter:wght@300;400;500;600&display=swap");

:root {
  --ink: #fcfaf7;            /* warm paper-white foreground */
  --paper: #0a0a0a;          /* deep ink background */
  --surface: #141414;        /* elevated cards */
  --surface-2: #1a1a1a;      /* slightly higher elevation */
  --graphite: #9a9a9a;       /* muted text */
  --mist: #2a2a2a;           /* dividers & hairlines */
  --hairline: rgba(252, 250, 247, 0.14);
  --hairline-2: rgba(252, 250, 247, 0.08);

  --error: #e26868;
  --success: #7dd38b;

  --font-display: "Playfair Display", "Didot", "Bodoni Moda", Georgia, serif;
  --font-ui: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: clamp(1.375rem, 1.1rem + 1.2vw, 1.875rem);
  --text-2xl: clamp(1.875rem, 1.3rem + 2.4vw, 2.75rem);
  --text-hero: clamp(2.75rem, 1.8rem + 5vw, 5.5rem);

  --s-1: 4px;  --s-2: 8px;  --s-3: 12px; --s-4: 16px;
  --s-5: 24px; --s-6: 32px; --s-8: 48px; --s-10: 64px;
  --s-12: 96px; --s-16: 128px;

  --container: 1200px;
  --radius: 2px;
}

*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  color-scheme: dark;
}
body {
  margin: 0;
  font-family: var(--font-ui);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss01", "cv11", "cv05";
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, h5, h6 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
input, textarea, select { font: inherit; color: inherit; }
hr { border: 0; border-top: 1px solid var(--hairline); margin: 0; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* -------- Typography helpers -------- */
.eyebrow {
  font-family: var(--font-ui);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--graphite);
}
.display {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-hero);
  line-height: 1.02;
  letter-spacing: -0.02em;
}
.display em { font-style: italic; font-weight: 400; }
.title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-2xl);
  line-height: 1.1;
  letter-spacing: -0.015em;
}
.lede {
  font-size: clamp(var(--text-base), 0.95rem + 0.35vw, var(--text-lg));
  line-height: 1.55;
  color: var(--graphite);
  max-width: 60ch;
}
.micro {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--graphite);
}

/* -------- Brand lockup (double-rule wordmark) -------- */
.brand {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  line-height: 1;
  color: var(--ink);
}
.brand-word {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.brand-rule {
  display: block;
  width: 100%;
  height: 1px;
  background: currentColor;
  position: relative;
}
.brand-rule::after {
  content: "";
  position: absolute; left: 0; right: 0;
  top: 3px; height: 1px; background: currentColor;
}
.brand-tag {
  font-family: var(--font-ui);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.34em;
  color: var(--graphite);
  margin-top: 6px;
}

/* -------- Buttons -------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: var(--s-2);
  padding: 14px 22px;
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: var(--radius);
  transition: transform 200ms cubic-bezier(0.16,1,0.3,1),
              background 200ms ease, color 200ms ease, border-color 200ms ease;
  white-space: nowrap;
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-sm { padding: 10px 18px; font-size: var(--text-xs); }
.btn-block { display: flex; width: 100%; }
.btn-primary {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.btn-primary:hover:not(:disabled) { background: #fff; border-color: #fff; transform: translateY(-1px); }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--ink);
}
.btn-ghost:hover:not(:disabled) { background: var(--ink); color: var(--paper); }
.btn-subtle {
  background: var(--surface);
  color: var(--graphite);
  border-color: var(--hairline);
}
.btn-subtle:hover:not(:disabled) { color: var(--ink); border-color: var(--ink); }
.btn-danger {
  background: transparent;
  color: var(--error);
  border-color: rgba(226, 104, 104, 0.5);
}
.btn-danger:hover:not(:disabled) { background: var(--error); color: var(--paper); border-color: var(--error); }

/* -------- Form inputs -------- */
.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: var(--s-5);
}
.field label {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--graphite);
}
.input, input[type="text"].input, input[type="email"].input, input[type="password"].input, textarea.input, select.input {
  width: 100%;
  padding: 13px 16px;
  background: transparent;
  border: 1px solid var(--hairline);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: var(--text-base);
  border-radius: var(--radius);
  outline: none;
  transition: border-color 160ms ease, background 160ms ease;
}
.input:focus, .input:focus-visible { border-color: var(--ink); background: rgba(252,250,247,0.02); }
.input::placeholder { color: rgba(252,250,247,0.3); }
.input.ok { border-color: rgba(125, 211, 139, 0.6); }
.input.bad { border-color: rgba(226, 104, 104, 0.6); }

/* -------- Messages (replace old success/error-msg patterns) -------- */
.msg {
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: var(--text-sm);
  line-height: 1.5;
  display: none;
  margin-bottom: var(--s-4);
}
.msg.visible { display: block; }
.msg.error   { background: rgba(226,104,104,0.08); border: 1px solid rgba(226,104,104,0.3); color: var(--error); }
.msg.success { background: rgba(125,211,139,0.08); border: 1px solid rgba(125,211,139,0.3); color: var(--success); }
.msg.info    { background: rgba(252,250,247,0.04); border: 1px solid var(--hairline); color: var(--graphite); }

/* -------- Cards & surfaces -------- */
.card {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: var(--s-6);
}

/* -------- Auth card (login/signup/reset) -------- */
.auth-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--s-8) var(--s-4);
}
.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: var(--s-8) var(--s-6);
}
.auth-card .brand { margin: 0 auto var(--s-6); }
.auth-card h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-xl);
  text-align: center;
  margin-bottom: var(--s-5);
  letter-spacing: -0.01em;
}
.auth-sub {
  text-align: center;
  color: var(--graphite);
  font-size: var(--text-sm);
  margin: calc(-1 * var(--s-4)) 0 var(--s-6);
}

/* -------- Legal-page footer bar (small links on auth/app pages) -------- */
.legal-bar {
  margin-top: var(--s-8);
  text-align: center;
  font-size: var(--text-xs);
  color: var(--graphite);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.legal-bar a {
  color: var(--graphite);
  margin: 0 10px;
  transition: color 160ms ease;
}
.legal-bar a:hover { color: var(--ink); }

/* -------- Utility -------- */
.container { max-width: var(--container); margin-inline: auto; padding-inline: clamp(var(--s-4), 4vw, var(--s-8)); }
.flex { display: flex; }
.between { display: flex; align-items: center; justify-content: space-between; }
.center { display: flex; align-items: center; justify-content: center; }
.gap-2 { gap: var(--s-2); } .gap-3 { gap: var(--s-3); } .gap-4 { gap: var(--s-4); }

/* -------- Reduced motion -------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0ms !important; transition-duration: 0ms !important; }
  html { scroll-behavior: auto; }
}
