/* AG-CANON-1 / AG-APP-MATCH-1: the theme layer, shared by every surface (studio, dashboard, account, sign-in, sign-up, first-run setup, help, signer pages, forms).
 *
 * The tokens below are lifted VERBATIM from the marketing site's stylesheet (autograph-site, src/style.css at commit 9aa93d9; the parchment
 * pair from the same file at commit 65bd8a0, the last commit that carried it). No hex value here is invented. Names starting --site- are the
 * lifted values with the site's own names; the --canon-* and --bg-* / --text-* names the pages already use are mapped onto them.
 *
 *   ground    #0A0E1A   page                       (site --ground)
 *   charcoal  #232324   the app header             (site --charcoal)
 *   panel     #0F1420   cards, panels, dialogs     (site --panel)
 *   hairline  rgba(238, 240, 245, 0.10)  every line  (site --hairline); strong 0.24 (site --hairline-strong)
 *   text      #EEF0F5, #A3A9B8, #8A93A8            (site --text, --text-2, --text-3)
 *   old gold  #C9A227 (hover #DDBA45, text on it #0A0E1A)  the account holder's actions only: primary buttons and calls to action
 *   parchment #F7F4EE, ink #1F1B16, #5E554A, rule rgba(31, 27, 22, 0.14)   lifted, not used by any screen yet
 *
 * Bright gold (the signing process only) has NO value in the site's stylesheet, and none is invented here: no bright gold is used anywhere.
 * The site's stylesheet has no navy accent either (it was retired in AG-SITE-UNSLOP-1), so none is used.
 * No light theme anywhere. The one white thing is the document itself (the PDF page a person is signing), which is the user's
 * paper, not the product's surface. Status colors, the per-signer placement colors and the few derived tints below are functional
 * (they are not theme colors) and are named here so they stay in one place.
 *
 * Inter is shipped with the surface (public/fonts, SIL Open Font License 1.1, see public/fonts/OFL.txt): the files are real, the
 * @font-face rules below point at them, and a test fails if the files or the rules go missing.
 */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/inter-latin-400.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/inter-latin-500.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/inter-latin-600.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/inter-latin-700.woff2') format('woff2');
}

:root {
  color-scheme: dark;

  /* lifted from the site's stylesheet (see the header above) */
  --site-ground: #0A0E1A;
  --site-charcoal: #232324;
  --site-panel: #0F1420;
  --site-hairline: rgba(238, 240, 245, 0.10);
  --site-hairline-strong: rgba(238, 240, 245, 0.24);
  --site-text: #EEF0F5;
  --site-text-2: #A3A9B8;
  --site-text-3: #8A93A8;
  --site-gold: #C9A227;
  --site-gold-hover: #DDBA45;
  --site-on-gold: #0A0E1A;
  --site-paper: #F7F4EE;
  --site-paper-ink: #1F1B16;
  --site-paper-2: #5E554A;
  --site-paper-rule: rgba(31, 27, 22, 0.14);

  /* the names the pages already use, mapped onto the lifted values */
  --canon-base: var(--site-ground);
  --canon-panel: var(--site-panel);
  --canon-border: var(--site-hairline);
  --canon-text: var(--site-text);
  --canon-muted: var(--site-text-2);
  --canon-gold: var(--site-gold);
  --canon-header: var(--site-charcoal);

  /* functional (not theme colors) */
  --canon-raised: var(--site-hairline);       /* a panel's hover / selected tint (the hairline, laid over the panel) */
  --canon-sunken: var(--site-ground);         /* an input well, a quiet fill */
  --canon-border-strong: var(--site-hairline-strong);
  --canon-ok: #4FD0A0;
  --canon-danger: #F2828C;
  --canon-on-light: #0A0E1A;    /* text on the light button (the signer's button) */

  --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: var(--font-sans); /* Inter only, numbers included (AG-APP-MATCH-1) */

  /* names the surfaces' stylesheets already use, mapped onto the canon */
  --bg-app: var(--canon-base);
  --bg-surface: var(--canon-panel);
  --bg-subtle: var(--canon-sunken);
  --bg-paper: #ffffff;
  --border: var(--canon-border);
  --border-strong: var(--canon-border-strong);
  --text-primary: var(--canon-text);
  --text-secondary: var(--canon-muted);
  --text-muted: var(--site-text-3);
  --accent: var(--canon-text);
  --accent-hover: var(--site-text-2);
  --accent-subtle: var(--canon-raised);
  --on-accent: var(--canon-on-light);
  --success: var(--canon-ok);
  --success-subtle: #0F2A25;
  --danger: var(--canon-danger);
  --danger-hover: #E5636F;
  --danger-subtle: #2B1620;
  --warning: var(--canon-muted);
  --warning-subtle: var(--canon-sunken);

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 16px;
  --space-4: 24px;
  --space-5: 32px;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 8px;
  --shadow-paper: 0 6px 28px -4px rgba(0, 0, 0, 0.55), 0 2px 8px -2px rgba(0, 0, 0, 0.4);
  --shadow-card: 0 1px 0 0 rgba(255, 255, 255, 0.02);
  --shadow-modal: 0 24px 48px -12px rgba(0, 0, 0, 0.7);

  /* the dashboard and the form pages use these names */
  --bg: var(--canon-base);
  --card: var(--canon-panel);
  --ink: var(--canon-text);
  --muted: var(--canon-muted);
  --line: var(--canon-border);
  --accent-ink: var(--canon-on-light);
  --warn-bg: var(--canon-raised);
  --warn-ink: var(--canon-text);
  --err: var(--canon-danger);
  --ok: var(--canon-ok);
}

html {
  background: var(--canon-base);
  font-variant-numeric: tabular-nums;
}

body {
  font-family: var(--font-sans);
  background: var(--canon-base);
  color: var(--canon-text);
  -webkit-font-smoothing: antialiased;
}

input, select, textarea, button {
  font-family: inherit;
  color: inherit;
}

input, select, textarea {
  background: var(--canon-sunken);
  color: var(--canon-text);
  border: 1px solid var(--canon-border);
  border-radius: var(--radius-md);
}

input::placeholder, textarea::placeholder {
  color: var(--site-text-3);
}

a {
  color: var(--canon-text);
}

::selection {
  background: var(--site-hairline-strong);
  color: var(--canon-text);
}

/* ---- the logo: the approved Autograph mark (public/assets/wordmark.svg, a copy of the marketing site's asset), used as an image ---- */
.brand-logo {
  display: block;
  height: auto;
  max-width: 100%;
}

/* ---- shared cards, fields and buttons for the front-door pages ---- */
.canon-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  background: var(--canon-base);
}
.canon-card {
  width: 100%;
  max-width: 420px;
  background: var(--canon-panel);
  border: 1px solid var(--canon-border);
  border-radius: var(--radius-lg);
  padding: 32px;
}
.canon-card .brand-logo,
.login-brand .brand-logo {
  margin: 0 auto 20px;
}
.canon-card h1 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.3px;
  margin: 0 0 6px;
}
.canon-card p.lede {
  color: var(--canon-muted);
  margin: 0 0 22px;
  font-size: 14px;
  line-height: 1.55;
}
.canon-field {
  display: block;
  margin: 0 0 14px;
}
.canon-field > span {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin: 0 0 6px;
}
.canon-field > small {
  display: block;
  color: var(--canon-muted);
  font-size: 12px;
  margin-top: 5px;
}
.canon-field input {
  width: 100%;
  padding: 11px 12px;
  font-size: 15px;
}
.canon-field input:focus-visible,
.btn:focus-visible,
a:focus-visible {
  outline: 2px solid var(--canon-text);
  outline-offset: 2px;
}
.canon-btn {
  width: 100%;
  margin-top: 6px;
  padding: 12px 16px;
  font-size: 15px;
  font-weight: 600;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: var(--canon-text);
  color: var(--canon-on-light);
  cursor: pointer;
}
.canon-btn:hover:not(:disabled) {
  background: var(--site-text-2);
}
.canon-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.canon-btn.quiet {
  background: transparent;
  color: var(--canon-text);
  border-color: var(--canon-border-strong);
}
.canon-links {
  margin: 18px 0 0;
  font-size: 14px;
  color: var(--canon-muted);
  text-align: center;
}
.canon-note {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  font-size: 14px;
  line-height: 1.5;
  border: 1px solid var(--canon-border);
  background: var(--canon-sunken);
}
.canon-note.bad {
  border-color: var(--canon-danger);
  color: var(--canon-danger);
  background: var(--danger-subtle);
}
.canon-note.good {
  border-color: var(--canon-ok);
  color: var(--canon-ok);
  background: var(--success-subtle);
}
[hidden] {
  display: none !important;
}
