/* Shared paper-aesthetic styling for the auth / secondary pages (sign-in,
   reset-password, change-password, verify-otp-code, verify, sign-out, error).
   Mirrors the tokens + component classes used by index.html / verify-document.html
   so these pages match the certify and verify designs. Replaces Bootstrap on
   those pages. Loaded INSTEAD of bootstrap + site.css there. */

:root {
  --paper: #F4F0E6;
  --paper-2: #EDE7D7;
  --card: #FBF8F0;
  --card-edge: #E5DFC9;
  --ink: #15140F;
  --ink-2: #2C2A22;
  --dim: #76715F;
  --dim-2: #98927D;
  --line: #D7D0BB;
  --accent: #B83A2B;
  --accent-ink: #7A2117;
  --accent-soft: #F1D9D3;
  --positive: #2F6B3E;
  --danger: #B83A2B;
  --shadow-1: 0 1px 0 rgba(21,20,15,0.04), 0 1px 2px rgba(21,20,15,0.06);
  --shadow-2: 0 8px 24px -10px rgba(21,20,15,0.22), 0 1px 0 rgba(21,20,15,0.06);
  --radius: 6px;
  --radius-lg: 10px;
  --sans: "Geist", "Söhne", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --serif: "Newsreader", "GT Sectra", "Source Serif 4", Georgia, serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", "JetBrains Mono", Menlo, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; min-height: 100%; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss01" on, "cv11" on;
}
button { font-family: inherit; cursor: pointer; }
input, textarea, select, button { font-family: inherit; color: inherit; }
::selection { background: var(--accent); color: #fff; }

/* Paper grain */
body::before {
  content: "";
  position: fixed; inset: 0; pointer-events: none;
  background-image: radial-gradient(rgba(21,20,15,0.025) 1px, transparent 1px);
  background-size: 3px 3px; opacity: .6; z-index: 0; mix-blend-mode: multiply;
}

/* en/fr toggle (mirrors /css/lynxseal.css) */
body:not(.lang-fr) .fr-only { display: none; }
body.lang-fr .en-only { display: none; }

/* Type */
.display-md { font-family: var(--serif); font-weight: 400; font-size: 26px; line-height: 1.15; letter-spacing: -0.015em; }
.eyebrow { font-family: var(--mono); font-size: 10.5px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--dim); }
.meta { color: var(--dim); font-size: 12px; }
.mono { font-family: var(--mono); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }

/* Topbar (matches index / verify) */
.topbar {
  height: 56px; flex-shrink: 0;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  display: flex; align-items: center;
  padding: 0 20px; gap: 14px;
  position: relative; z-index: 1;
}
.topbar .wordmark {
  font-family: var(--serif); font-style: italic; font-weight: 400;
  font-size: 22px; letter-spacing: -0.01em; color: var(--ink);
  display: inline-flex; align-items: center; gap: 8px; text-decoration: none;
}
.topbar .wordmark img { max-height: 32px; max-width: 140px; object-fit: contain; display: block; }
.topbar .breadcrumb { font-size: 13px; color: var(--ink-2); display: inline-flex; align-items: center; gap: 6px; }
.topbar .powered-by { font-size: 11.5px; color: var(--dim); display: inline-flex; align-items: center; gap: 5px; text-decoration: none; }
.topbar .powered-by:hover { color: var(--ink-2); }
.topbar .powered-by .powered-logo { height: 18px; width: 18px; display: block; }
.topbar-spacer { flex: 1; }
.vr { display: inline-block; width: 1px; height: 20px; background: var(--line); margin: 0 4px; vertical-align: middle; }

/* Centered card stage */
.auth-stage { position: relative; z-index: 1; min-height: calc(100vh - 56px); display: flex; align-items: flex-start; justify-content: center; padding: 48px 24px; }
.auth-card { width: 100%; max-width: 460px; padding: 32px; }
.card { background: var(--card); border: 1px solid var(--card-edge); border-radius: var(--radius-lg); box-shadow: var(--shadow-1); }
.auth-card h1, .auth-card h2 { margin: 0 0 6px; }
.auth-card .sub { color: var(--dim); font-size: 13px; margin: 0 0 24px; }

/* Fields */
.field { margin-bottom: 18px; }
.label { display: block; font-size: 12px; font-weight: 500; letter-spacing: 0.01em; color: var(--ink-2); margin-bottom: 6px; }
.ctrl { width: 100%; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; font-size: 14px; color: var(--ink); transition: border-color .12s, box-shadow .12s; font-family: inherit; }
.ctrl:hover { border-color: var(--dim-2); }
.ctrl:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(21,20,15,0.08); }
.check-row { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); }
.check-row input[type=checkbox] { accent-color: var(--accent); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 14px; border-radius: var(--radius); font-size: 13px; font-weight: 500; border: 1px solid transparent; background: transparent; color: var(--ink); transition: background .12s, border-color .12s, color .12s, transform .04s; white-space: nowrap; text-decoration: none; }
.btn:active { transform: translateY(0.5px); }
.btn.accent { background: var(--accent); color: #FFF8F4; }
.btn.accent:hover { background: var(--accent-ink); }
.btn.ghost { background: var(--card); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--dim-2); background: #FFFCF3; }
.btn.lg { height: 44px; font-size: 14px; padding: 0 18px; }
.btn.block { width: 100%; }

/* Links */
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.muted-link { color: var(--dim); font-size: 13px; }

/* Alerts */
.alert { padding: 10px 14px; border-radius: var(--radius); font-size: 13px; margin-bottom: 16px; }
.alert-danger { background: var(--accent-soft); color: var(--accent-ink); border: 1px solid #E6B9B0; }
.alert-info { background: var(--paper-2); color: var(--ink-2); border: 1px solid var(--line); }
.alert-success { background: #DCEBDD; color: #1F4D2C; border: 1px solid #B9D4BD; }

/* Spinner for interstitials (SSO, signing out) */
.spinner { width: 26px; height: 26px; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; margin: 8px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
