/* Gate page: public, so it may only load files under /assets/gate/. Same tokens as the board (subset). */
@font-face { font-family: 'Anuphan'; font-weight: 400; font-display: swap; src: url(fonts/anuphan-thai-400-normal.woff2) format('woff2'); unicode-range: U+0E01-0E5B, U+200C-200D, U+25CC; }
@font-face { font-family: 'Anuphan'; font-weight: 600; font-display: swap; src: url(fonts/anuphan-thai-600-normal.woff2) format('woff2'); unicode-range: U+0E01-0E5B, U+200C-200D, U+25CC; }
@font-face { font-family: 'Anuphan'; font-weight: 400; font-display: swap; src: url(fonts/anuphan-latin-400-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F; }
@font-face { font-family: 'Anuphan'; font-weight: 600; font-display: swap; src: url(fonts/anuphan-latin-600-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F; }

:root {
  color-scheme: light dark;
  --bg: #F6F4FA;
  --surface: #FFFFFF;
  --line: #E4E0EC;
  --line-strong: #CFC6E0;
  --ink: #1F1B2E;
  --ink-2: #57526C;
  --ink-3: #6A6580;
  --brand: #3B1F5F;
  --brand-deep: #2A1745;
  --on-brand: #FFFFFF;
  --accent: #6236D6;
  --focus: #6236D6;
  --error: #A9461A;
  --error-soft: #FCEBDF;
  --glow: rgba(130, 77, 251, .10);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #120B26;
    --surface: #1A1233;
    --line: #2F2652;
    --line-strong: #42376E;
    --ink: #EEEAF8;
    --ink-2: #BDB6D3;
    --ink-3: #A39CBD;
    --brand: #D9CAFE;
    --brand-deep: #EDE6FF;
    --on-brand: #1A1233;
    --accent: #BCA4FF;
    --focus: #C4AEFF;
    --error: #F2915E;
    --error-soft: #3A1E12;
    --glow: rgba(54, 33, 92, .9);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  min-height: 100dvh;
  background: radial-gradient(1100px 620px at 20% -10%, var(--glow), transparent 70%), var(--bg);
  color: var(--ink);
  font-family: 'Anuphan', 'Noto Sans Thai', 'Thonburi', system-ui, sans-serif;
  font-size: 14px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
.gate { min-height: 100dvh; display: grid; place-items: center; align-content: center; gap: 20px; padding: 24px 16px; }
.gate__card {
  width: min(420px, 100%);
  display: grid; gap: 10px;
  padding: 32px 28px 28px;
  border: 1px solid var(--line); border-radius: 20px;
  background: var(--surface);
  box-shadow: 0 18px 48px rgba(45, 35, 80, .14);
}
.gate__mark { width: 44px; height: 44px; margin-bottom: 6px; }
.gate__eyebrow { margin: 0; font-size: 12px; font-weight: 600; color: var(--accent); letter-spacing: .02em; }
.gate__title { margin: 0; font-size: 22px; font-weight: 600; line-height: 1.3; }
.gate__lede { margin: 0 0 8px; color: var(--ink-2); }
.gate__form { display: grid; gap: 8px; }
.gate__label { font-size: 13px; font-weight: 600; }
.gate__row { display: flex; gap: 8px; }
.gate__input {
  flex: 1; min-width: 0; height: 44px; padding: 0 12px;
  border: 1px solid var(--line-strong); border-radius: 10px;
  background: var(--surface); color: var(--ink);
  font: inherit; font-size: 16px;
}
.gate__input[aria-invalid='true'] { border-color: var(--error); }
.gate__btn {
  height: 44px; padding: 0 18px; border: 0; border-radius: 10px;
  background: var(--brand); color: var(--on-brand);
  font: inherit; font-weight: 600; white-space: nowrap; cursor: pointer;
}
.gate__btn:hover { background: var(--brand-deep); }
.gate__btn:disabled { opacity: .7; cursor: progress; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.gate__input:focus-visible { outline-offset: 0; border-color: var(--focus); }
.gate__error { margin: 0; padding: 8px 12px; border-radius: 10px; background: var(--error-soft); color: var(--ink); font-size: 13px; border-left: 3px solid var(--error); }
.gate__help { margin: 4px 0 0; font-size: 12px; color: var(--ink-3); }
.gate__foot { margin: 0; font-size: 12px; color: var(--ink-3); text-align: center; }
[hidden] { display: none !important; }
@media (max-width: 380px) { .gate__row { flex-direction: column; } .gate__card { padding: 24px 20px; } }
