/* AG-CANON-1: the canon, shared by every surface (studio, dashboard, sign-in, sign-up, first-run setup, signer pages, forms).
 *
 *   base   #0A0E1A   page
 *   panel  #111A2E   cards, panels, dialogs
 *   border #22304D   every line
 *   text   #F5F7FA   main text
 *   muted  #B8C0CC   secondary text
 *   gold   #C9A227   used sparingly ONLY: the logo nib, the completion seal, rare emphasis. Never a button, link or fill.
 *
 * 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 and the few derived tints below are functional (they are not canon 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;

  /* the canon */
  --canon-base: #0A0E1A;
  --canon-panel: #111A2E;
  --canon-border: #22304D;
  --canon-text: #F5F7FA;
  --canon-muted: #B8C0CC;
  --canon-gold: #C9A227;

  /* functional (not canon colors) */
  --canon-raised: #16223C;      /* a panel's hover / selected tint */
  --canon-sunken: #0D1424;      /* an input well, a quiet fill */
  --canon-border-strong: #33466E;
  --canon-ok: #4FD0A0;
  --canon-danger: #F2828C;
  --canon-on-light: #0A0E1A;    /* text on the light primary button */

  --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* 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(--canon-muted);
  --accent: var(--canon-text);
  --accent-hover: #DDE2EA;
  --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: 12px;
  --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);
}

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: #7F8AA0;
}

a {
  color: var(--canon-text);
}

::selection {
  background: #2A3B63;
  color: var(--canon-text);
}

/* ---- the wordmark: a stylized A whose left stroke is a fountain pen with a gold nib, then "utograph" in Inter Bold ---- */
.wordmark {
  display: inline-flex;
  align-items: baseline;
  gap: 0;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.4px;
  color: var(--canon-text);
  text-decoration: none;
  line-height: 1;
}
.wordmark .wordmark-a {
  width: 1.02em;
  height: 1.16em;
  align-self: flex-end;
  margin-right: 0.01em;
  transform: translateY(0.16em);
  flex: 0 0 auto;
}
.wordmark .wordmark-rest {
  display: inline-block;
}
.wordmark .nib {
  fill: var(--canon-gold);
}
.wordmark .pen,
.wordmark .leg {
  fill: var(--canon-text);
}
.wordmark .bar {
  stroke: var(--canon-text);
}
.wordmark .slit {
  stroke: var(--canon-base);
}
.wordmark .eye {
  fill: var(--canon-base);
}
.wordmark.large {
  font-size: 34px;
}

/* ---- 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 .wordmark {
  margin-bottom: 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: #DDE2EA;
}
.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;
}
