/* The welcome screen: a loading screen while the server answers, then two slips, one for
   passengers (no account) and one for staff sign in. Builds on slip-base.css. */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body.gate { margin: 0; min-height: 100dvh; background: var(--paper); color: var(--ink); font: 400 16px/1.45 var(--ui); }
h1, p { margin: 0; }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }

/* ---- loading */
.gate-load {
  position: fixed; inset: 0; z-index: 3000; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; padding: 24px; text-align: center; color: var(--white);
  background: var(--blue);
  transition: opacity 0.32s var(--ease), visibility 0s linear 0.32s;
}
body:not(.is-loading) .gate-load { opacity: 0; visibility: hidden; }
.gate-load img { width: min(240px, 62vw); height: auto; border-radius: 50%; margin-bottom: 16px; }
.gate-name { font-size: 28px; line-height: 1.15; font-weight: 600; }
.gate-name b { font-weight: 400; color: #c9d8ff; }
.gate-tag { font-family: var(--mono); font-size: 13px; color: #c9d8ff; }
.gate-bar { width: 180px; height: 4px; margin-top: 24px; background: rgba(255, 255, 255, 0.22); border-radius: 2px; overflow: hidden; }
.gate-bar span { display: block; width: 40%; height: 100%; background: var(--white); border-radius: 2px; animation: gate-run 1.2s var(--ease) infinite; }
@keyframes gate-run { from { transform: translateX(-100%); } to { transform: translateX(250%); } }
.gate-msg { min-height: 1.45em; font-size: 14px; color: #dbe5ff; }

/* ---- the choices: the header's blue runs on as a band, the slips laid over its edge */
body.gate { background: linear-gradient(var(--blue) 0 200px, var(--paper) 200px) no-repeat, var(--paper); }
.gate-main { max-width: 480px; margin: 0 auto; padding: 24px 16px calc(40px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 16px; }
.gate-hero { display: flex; align-items: center; gap: 16px; margin-bottom: 8px; color: var(--white); }
.gate-hero img { flex: none; width: 72px; height: 72px; border-radius: 50%; box-shadow: 0 0 0 2px var(--white); }
.gate-main h1 { font-size: 30px; line-height: 1.15; font-weight: 500; }
.gate-lede { color: #dbe5ff; margin-top: 4px; font-size: 15px; }
.gate-offline { padding: 12px 16px; border-radius: 12px; background: var(--white); box-shadow: inset 0 0 0 1px var(--rule); color: var(--stop); font-weight: 500; }
.gate-offline[hidden], .gate-card[hidden] { display: none; }

.gate-card { padding: 24px 20px 20px; display: flex; flex-direction: column; gap: 16px; }
.gate-card > p { color: var(--ink-2); font-size: 15px; }
.gate-field { display: flex; flex-direction: column; gap: 8px; font-size: 14px; font-weight: 500; color: var(--ink-2); }
.gate-input {
  width: 100%; min-height: 52px; padding: 0 16px; border: 1px solid var(--rule-strong); border-radius: 10px;
  background: var(--white); color: var(--ink); font-size: 18px; font-weight: 400;
}
.gate-input:focus { border-color: var(--blue); outline: none; box-shadow: 0 0 0 1px var(--blue); }
.gate-input::placeholder { color: var(--ink-3); }
.gate-input.pin { font-family: var(--mono); font-size: 22px; letter-spacing: 0.4em; }
.gate-error { color: var(--stop); font-weight: 500; font-size: 15px; }
.gate-note { font-size: 13px; color: var(--ink-3); }

.gate-go {
  display: flex; align-items: center; justify-content: center; width: 100%; min-height: 52px;
  border: 0; border-radius: 12px; background: var(--red); color: var(--white);
  font-size: 17px; font-weight: 600; cursor: pointer; transition: transform 0.12s var(--ease), background-color 0.15s var(--ease);
}
.gate-go:hover { background: #bf1a25; }
.gate-go:active { transform: scale(0.98); }
.gate-go:disabled { opacity: 0.5; cursor: progress; }
/* red is the passenger's action; staff actions are navy, so the screen has one loud button */
#signin .gate-go, #newpin .gate-go { background: var(--ink); }
/* staff sign-in folded away: a quiet text link under the passenger card */
.gate-staff {
  align-self: center; display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; border: 0; background: none; cursor: pointer;
  font: 500 15px var(--ui); color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px;
}
.gate-staff:hover { color: var(--ink); }
.gate-staff[hidden] { display: none; }
#signin .gate-go:hover, #newpin .gate-go:hover { background: #1a2a63; }

@media (prefers-reduced-motion: reduce) {
  .gate-load { transition: none; }
  .gate-bar span { animation: none; width: 100%; }
  .gate-go { transition: none; }
}
