/* Standalone styles for /a (approvals), /s (one-time secrets) and their not-found page.
   These pages run under a strict CSP and do not load style.css, so the palette is repeated
   here. Same-origin assets only.

   Fonts: the page CSP (STRICT_CSP in app/core/objects/pages.py) has default-src 'none' and
   no font-src, so the browser refuses the site's web fonts here. Until "font-src 'self'" is
   added to that policy, these pages use the visitor's system fonts. Once it is
   added, uncomment the two rules below and the pages pick up Archivo and JetBrains Mono.

@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
  src: url('../fonts/archivo-var-latin.woff2?v=1') format('woff2');
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url('../fonts/jetbrains-mono-var-latin.woff2?v=1') format('woff2');
}
*/
:root {
  color-scheme: dark;
  --bg: #0c0c0b;
  --surface: #141412;
  --surface-2: #1b1b18;
  --code-bg: #090908;
  --border: #2a2925;
  --border-strong: #3a3833;
  --text: #ecebe6;
  --text-dim: #b3b1a8;
  --text-faint: #8f8c84;
  --accent: #f0b44c;
  --accent-hi: #f5c46c;
  --accent-ink: #17130a;
  --accent-dim: rgba(240, 180, 76, 0.12);
  --ok: #8fcf7a;
  --err: #ef6b5b;
  --get: #8fb8b0;
  --post: #9fd17f;
  --put: #b59cf0;
  --radius: 6px;
  --radius-lg: 10px;
  --strip: linear-gradient(90deg, var(--get) 0 25%, var(--post) 25% 50%, var(--accent) 50% 75%, var(--put) 75% 100%);
  --font-primary: 'Archivo', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  --font-display: 'Archivo', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { scrollbar-color: var(--border-strong) var(--bg); }
body {
  margin: 0;
  padding: 0 16px 48px;
  min-height: 100vh;
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 70% 45% at 85% -5%, rgba(240, 180, 76, 0.07), transparent 70%),
    radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 100% 100%, 22px 22px;
  background-repeat: no-repeat, repeat;
  color: var(--text);
  font: 16px/1.6 var(--font-primary);
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent-hi); outline-offset: 3px; }
[hidden] { display: none !important; }

.top, .card, .foot { max-width: 600px; margin-left: auto; margin-right: auto; }

/* ---- Brand bar ---- */
.top { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; padding: 22px 0 18px; }
.brand { font-family: var(--font-mono); font-size: 1.05rem; font-weight: 800; color: var(--text); text-decoration: none; }
.brand:hover { color: var(--accent); }
.brand-tld { color: var(--text-faint); font-weight: 400; }
.brand-cursor { display: inline-block; width: 0.55em; height: 1.05em; margin-left: 2px; background: var(--accent); vertical-align: -0.15em; }
.top-note { font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-faint); }

/* ---- Card ---- */
.card {
  position: relative;
  padding: 28px 26px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--strip); }
.eyebrow { margin: 0 0 10px; font-family: var(--font-mono); font-size: 0.78rem; color: var(--accent); }
h1 {
  margin: 0 0 16px;
  font-family: var(--font-display);
  font-stretch: 72%;
  font-weight: 850;
  font-size: clamp(1.6rem, 6vw, 2.1rem);
  line-height: 1.05;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}
p { margin: 0 0 14px; color: var(--text-dim); }
strong { color: var(--text); font-weight: 650; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--text); }
code {
  font-family: var(--font-mono);
  font-size: 0.84em;
  color: var(--accent);
  background: var(--accent-dim);
  padding: 0.08rem 0.35rem;
  border-radius: 3px;
  overflow-wrap: anywhere;
}

.note, .warning {
  padding: 12px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--get);
  border-radius: var(--radius);
  font-size: 0.92rem;
}
.warning { border-left-color: var(--accent); background: linear-gradient(90deg, var(--accent-dim), var(--surface-2) 60%); }

.question-label { margin: 22px 0 6px; font-family: var(--font-mono); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-faint); }
.question {
  margin: 0 0 6px;
  padding: 14px 16px;
  background: var(--code-bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 1.15rem;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* ---- Forms ---- */
label { display: block; margin: 20px 0 6px; font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-dim); }
textarea, input, select {
  display: block;
  width: 100%;
  padding: 10px 12px;
  font: inherit;
  color: var(--text);
  background: var(--code-bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
}
textarea:focus, input:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
textarea { min-height: 150px; resize: vertical; font-family: var(--font-mono); font-size: 0.9rem; }
input[readonly] { font-family: var(--font-mono); font-size: 0.85rem; }
.help { margin: 6px 0 0; font-size: 0.85rem; color: var(--text-faint); }
.help + .help, .choices + .help { margin-top: 14px; }
.copy-row { display: flex; gap: 8px; }
.copy-row input { flex: 1; min-width: 0; }
.copy-row button { flex: none; }
.result { margin-top: 24px; padding-top: 4px; border-top: 1px dashed var(--border-strong); }

.choices { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
button {
  padding: 10px 20px;
  font: inherit;
  font-weight: 600;
  color: var(--accent-ink);
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  cursor: pointer;
  overflow-wrap: anywhere;
}
button:hover { background: var(--accent-hi); border-color: var(--accent-hi); }
button.secondary { color: var(--text); background: transparent; border-color: var(--border-strong); }
button.secondary:hover { color: var(--accent); border-color: var(--accent); background: var(--surface-2); }
button:disabled { opacity: 0.55; cursor: default; }

.status { min-height: 1.6em; margin: 18px 0 0; color: var(--text); font-weight: 600; }
.status:empty { min-height: 0; margin: 0; }
.status-box { padding: 12px 14px; margin: 18px 0 14px; background: var(--surface-2); border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: var(--radius); }
.meta { margin: 22px 0 0; padding-top: 14px; border-top: 1px dashed var(--border-strong); color: var(--text-faint); font-size: 0.85rem; }

/* ---- Footer ---- */
.foot { padding: 20px 2px 0; }
.foot p { margin: 0 0 8px; font-size: 0.82rem; color: var(--text-faint); }

@media (max-width: 480px) {
  .card { padding: 24px 18px 20px; }
  .choices button { flex: 1 1 auto; }
}
