/* Gatehouse — pages the Worker writes itself (browser check, registration, admin sign-in, refusals,
   privacy, link-opener). System fonts only: these pages must never wait on a font host. The brand
   colour comes from --gh-brand when pages.js sets it inline; otherwise the neutral indigo below. */
:root {
  --gh-ink: #15172B; --gh-paper: #FAFAFD; --gh-line: #D5D9EA; --gh-lilac: #E9EBF5;
  --gh-text: #15172B; --gh-muted: #4A5070; --gh-on-dark: #fff; --gh-on-dark-muted: #B9BCDA;
  --gh-accent: var(--gh-brand, #5B5BD6);
  --gh-sans: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --gh-mono: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: radial-gradient(1200px 600px at 70% -10%, #2A2D5A 0%, transparent 60%), radial-gradient(900px 500px at -10% 110%, #1F2250 0%, transparent 55%), var(--gh-ink);
  color: var(--gh-on-dark); font: 400 16px/1.55 var(--gh-sans); -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%; text-size-adjust: 100%;
}
a { color: #C9CBF7; text-underline-offset: 3px; }
a:hover { color: #fff; }

.gate { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 28px; padding: 40px 16px; }
.gate-brand { display: inline-flex; align-items: center; gap: 10px; max-width: 100%; color: #fff; text-decoration: none; font: 800 20px/1.2 var(--gh-sans); letter-spacing: -0.01em; overflow-wrap: anywhere; }
.gate-brand:hover { color: #fff; }
.gate-brand .logo, .gate-brand svg { flex: none; width: 32px; height: 32px; }

.gate-card {
  width: min(440px, 100%); background: var(--gh-paper); color: var(--gh-text); border-radius: 18px; padding: clamp(22px, 5vw, 36px);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .2), 0 30px 80px -30px rgba(0, 0, 0, .65); text-align: left; overflow-wrap: anywhere;
}
.gate-wide .gate-card { width: min(620px, 100%); }
.gate-card h1 { font: 800 clamp(23px, 4.4vw, 30px)/1.15 var(--gh-sans); letter-spacing: -0.02em; margin: 6px 0 10px; }
.gate-card h2 { font: 800 18px/1.3 var(--gh-sans); margin: 22px 0 8px; }
.gate-card p { margin: 0 0 12px; }
.gate-card a { color: var(--gh-accent); }
.gate-eyebrow { margin: 0; font: 600 12px/1.4 var(--gh-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--gh-accent); }
.gate-lede { margin: 0 0 18px; color: var(--gh-muted); }
.gate-small { margin: 18px 0 0; font-size: 14px; color: var(--gh-muted); }
.gate-small a { color: var(--gh-accent); }
.gate-error { margin: 0 0 16px; padding: 10px 12px; border-radius: 10px; background: #FDECEC; color: #8A1C1C; font-weight: 500; }

.gate-form { margin: 0; }
.gate-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
@media (max-width: 560px) { .gate-grid { grid-template-columns: 1fr; } }
.gate-field { display: block; margin: 0 0 14px; }
.gate-field > span { display: block; margin: 0 0 6px; font-weight: 600; font-size: 14px; }
.gate-field em { font-style: normal; font-weight: 400; color: var(--gh-muted); }
.gate-field small { display: block; margin-top: 4px; color: var(--gh-muted); }
.gate-field input, .gate-field textarea, .gate-field select {
  width: 100%; padding: 11px 12px; border: 1px solid var(--gh-line); border-radius: 10px; background: #fff; color: var(--gh-text);
  font: 400 16px/1.4 var(--gh-sans); transition: border-color .15s, box-shadow .15s;
}
.gate-field textarea { resize: vertical; min-height: 84px; }
.gate-field input:focus, .gate-field textarea:focus, .gate-field select:focus { outline: none; border-color: var(--gh-accent); box-shadow: 0 0 0 3px rgba(91, 91, 214, .22); }
.gate-check { display: flex; gap: 10px; align-items: flex-start; margin: 4px 0 18px; font-size: 14px; color: var(--gh-muted); }
.gate-check input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--gh-accent); flex: none; }
/* the honeypot: off-screen for people, still in the form for scripts */
.gate-hp { position: absolute !important; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; }

.gate-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 100%; min-height: 48px; padding: 0 22px; border: 0; border-radius: 12px;
  background: var(--gh-accent); color: #fff; font: 700 16px/1 var(--gh-sans); text-decoration: none; cursor: pointer; transition: filter .15s, transform .15s;
}
.gate-btn:hover { filter: brightness(1.08); color: #fff; }
.gate-btn:active { transform: translateY(1px); }
.gate-btn:focus-visible { outline: 3px solid #A9ABF5; outline-offset: 2px; }

.gate-spin { width: 36px; height: 36px; border-radius: 50%; border: 3px solid var(--gh-lilac); border-top-color: var(--gh-accent); animation: gate-spin .9s linear infinite; margin-bottom: 14px; }
@keyframes gate-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .gate-spin { animation-duration: 3s; } }
/* check.js marks the box when it has stopped trying (an automated browser) */
.gh-failed .gate-spin { display: none; }
#gh-check-msg:empty { display: none; }

.gate-foot { margin: 0; max-width: 620px; font-size: 13px; color: var(--gh-on-dark-muted); text-align: center; overflow-wrap: anywhere; }
.gate-foot a { color: var(--gh-on-dark-muted); }

/* the privacy page */
.gate-doc { width: min(720px, 100%); }
.gate-doc h2 { margin: 26px 0 8px; font: 800 18px/1.3 var(--gh-sans); letter-spacing: -0.01em; }
.gate-doc p, .gate-doc li { color: var(--gh-muted); }
.gate-doc ul { margin: 0; padding-left: 20px; }
.gate-doc li { margin: 0 0 8px; }
.gate-doc b { color: var(--gh-text); }
.gate-card code, .gate-doc code { font: 500 13px var(--gh-mono); background: var(--gh-lilac); padding: 1px 5px; border-radius: 5px; color: var(--gh-text); }
.gate-card table { width: 100%; border-collapse: collapse; font-size: 14px; margin: 8px 0 14px; }
.gate-card th, .gate-card td { text-align: left; padding: 6px 8px 6px 0; border-bottom: 1px solid var(--gh-line); vertical-align: top; }
noscript p { color: var(--gh-muted); }
