/* Sign-in gate styles. Self-contained on purpose: these pages are served to
   visitors who are not signed in yet, so they cannot depend on /web/assets
   (the hosted deployment protects everything under /web/). The tokens below
   mirror web/assets/iadp-design-system.css so the gate and the app read as
   one product: the same rounded geometry and ink/panel/accent colours. */
:root {
  color-scheme: dark;
  --bg: #000000;
  --panel: #0E0E0E;
  --panel-2: #0A0A0A;
  --border: rgba(232,228,220,0.08);
  --border-strong: rgba(232,228,220,0.4);
  --ink: #EEEBE4;
  --ink-2: #BEB9AF;
  --ink-3: #8F8B82;
  --gold: #D4AF52;
  --danger: #FF5A4F;
  --good: #4CC38A;
  --accent: #E4DDCC;
  --accent-ink: #000000;
  --focus: rgba(228,221,204,.45);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Arial, 'Helvetica Neue', Frutiger, 'Segoe UI', -apple-system, sans-serif;
  min-height: 100%;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(24px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px))
           max(24px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  background: var(--bg);
}

.gate-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .12em;
  color: var(--gold);
  background: rgba(212,175,82,.10);
  border: 1px solid rgba(212,175,82,.45);
  padding: 5px 11px;
  border-radius: 999px;
  text-transform: uppercase;
}

.gate-card {
  width: 100%;
  max-width: 460px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 40px 34px;
}

.gate-card--wide { max-width: 720px; }

.gate-h1 {
  font-size: clamp(24px, 5vw, 32px);
  font-weight: 800;
  letter-spacing: -.01em;
  line-height: 1.2;
  margin: 16px 0 0;
  overflow-wrap: anywhere;
}

.gate-sub {
  margin: 14px 0 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-2);
}

.gate-field {
  margin-top: 22px;
}

.gate-label {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--ink-2);
  text-transform: uppercase;
  margin-bottom: 8px;
}

.gate-input {
  width: 100%;
  min-height: 48px;
  background: var(--panel-2);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 13px 14px;
  color: var(--ink);
  /* 16px stops iOS from zooming the page when a field takes focus. */
  font-size: 16px;
  font-family: inherit;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.gate-input::placeholder { color: var(--ink-3); opacity: 1; }
.gate-input:hover:not(:disabled) { border-color: rgba(232,228,220,.6); }
.gate-input:focus,
.gate-input:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
  border-color: var(--focus);
}
.gate-input[aria-invalid="true"] { border-color: var(--danger); }
.gate-input:disabled { opacity: .5; cursor: not-allowed; }

.gate-otp {
  letter-spacing: .5em;
  font-family: 'IBM Plex Mono', 'Red Hat Mono', 'SFMono-Regular', ui-monospace, monospace;
  font-size: 22px;
  text-align: center;
  /* The trailing letter-spacing would otherwise push the digits off-centre. */
  padding-left: calc(14px + .5em);
}

.gate-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  margin-top: 24px;
  padding: 14px;
  border-radius: 999px;
  border: 1px solid rgba(228,221,204,.4);
  background: rgba(228,221,204,.18);
  /* Tinted bone, as in the app: bone on this wash is above 9:1. */
  color: var(--accent);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 800;
  letter-spacing: .03em;
  text-transform: uppercase;
  cursor: pointer;
  transition: filter .15s ease, transform .1s ease;
}
.gate-btn:hover:not(:disabled) { filter: brightness(1.12); }
.gate-btn:active:not(:disabled) { transform: scale(.99); }
.gate-btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.gate-btn:disabled { opacity: .45; cursor: not-allowed; }

.gate-btn--ghost {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--ink);
  text-transform: none;
  font-weight: 600;
  letter-spacing: 0;
}

.gate-error {
  margin-top: 14px;
  padding: 11px 13px;
  border-radius: 8px;
  background: rgba(255,90,79,.10);
  border: 1px solid rgba(255,90,79,.35);
  color: #FF8A80;
  font-size: 13px;
  line-height: 1.5;
}
.gate-error[hidden] { display: none; }

.gate-hint {
  margin: 14px 0 0;
  font-size: 12px;
  line-height: 1.55;
  color: var(--ink-3);
  text-align: center;
}
.gate-hint a { color: var(--ink-2); text-decoration: underline; text-underline-offset: 2px; }
.gate-hint a:hover { color: var(--ink); }
.gate-hint a:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }

.gate-foot-link {
  background: none;
  border: none;
  color: var(--ink-2);
  font-size: 12px;
  font-family: inherit;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
}
.gate-foot-link:disabled { opacity: .4; cursor: not-allowed; text-decoration: none; }
.gate-foot-link:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }

.gate-spinner {
  display: inline-block;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 2px solid rgba(0,0,0,.3);
  border-top-color: var(--accent-ink);
  animation: gate-spin .7s linear infinite;
  margin-right: 8px;
  flex-shrink: 0;
}
@keyframes gate-spin { to { transform: rotate(360deg); } }

.gate-noscript { max-width: 460px; margin: 0 auto; }

@media (max-width: 480px) {
  .gate-card { padding: 28px 20px; }
  .gate-h1 { margin-top: 14px; }
}

/* Short landscape phones: let the page scroll from the top instead of
   centring a card taller than the screen (which hides its first lines). */
@media (max-height: 560px) {
  body { align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .gate-spinner { animation: none; border-top-color: var(--accent-ink); border-right-color: var(--accent-ink); }
}

@media (forced-colors: active) {
  .gate-card, .gate-input, .gate-btn, .gate-error, .gate-badge { border: 1px solid CanvasText; }
  .gate-btn { background: ButtonFace; color: ButtonText; }
  .gate-btn:focus-visible, .gate-input:focus-visible { outline: 2px solid Highlight; }
}

@media print {
  body { background: #fff; color: #000; display: block; }
  .gate-card { box-shadow: none; border-color: #777; background: none; }
  .gate-sub, .gate-label, .gate-hint { color: #000; }
  .gate-btn { display: none; }
}
