/*
 * Preview gate.
 *
 * Deliberately self-contained under /__gate/: everything below that prefix is
 * reachable without the access cookie and everything else is not, so this page
 * cannot reference /store.css or /fairly-logo-light.svg. It carries its own copy
 * of the two fonts, and the logo is inlined into the markup rather than linked —
 * a linked file would need adding to the allowlist in both gate functions, and a
 * gate that has to be edited in two CloudFront functions to change a logo is a
 * gate whose logo never changes.
 *
 * That self-containment is why the first version of this page drifted: it copied
 * its tokens from apps/web/styles/01-tokens.css, a path that no longer exists,
 * and it was uploaded by hand and tracked nowhere. The tokens below are copied
 * from public/store.css. Keep them in step; do not adjust for preference.
 */

@font-face {
  font-family: 'DM Sans';
  src: url('/__gate/dm-sans-latin.woff2') format('woff2');
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
}

@font-face {
  font-family: 'Manrope';
  src: url('/__gate/manrope-latin.woff2') format('woff2');
  font-style: normal;
  font-weight: 500 800;
  font-display: swap;
}

:root {
  --navy: #071d49;
  --blue: #1246a8;
  --blue-bright: #1559d6;
  --sky: #e8f2ff;
  --white: #ffffff;
  --warm-white: #fffdf8;
  --yellow: #f5c84c;
  --coral: #e9573f;
  --coral-dark: #c93f2c;
  --ink: #10203a;
  --muted: #526078;
  --line: #d8e0ec;
  --radius: 14px;
  --shadow: 0 24px 70px rgba(16, 32, 58, .14);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 20px;
  color: var(--ink);
  background: var(--warm-white);
  font: 400 17px/1.55 'DM Sans', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* The same dotted motif the storefront hero carries, at the same opacity. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  opacity: .16;
  background: radial-gradient(circle, var(--yellow) 3px, transparent 4px) 0 0 / 24px 24px;
  pointer-events: none;
}

.card {
  width: 100%;
  max-width: 34rem;
  position: relative;
  z-index: 1;
  padding: clamp(28px, 5vw, 48px);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.logo { display: inline-flex; margin-bottom: 28px; }
.logo-art { width: 150px; height: auto; display: block; }

h1 {
  margin: 0 0 14px;
  color: var(--navy);
  font: 800 clamp(30px, 4vw, 40px)/1.05 'Manrope', sans-serif;
  letter-spacing: -.04em;
}

.lede { margin: 0 0 30px; color: var(--muted); font-size: 16px; }

label {
  display: block;
  margin-bottom: 8px;
  color: var(--navy);
  font-size: 14px;
  font-weight: 700;
}

/* 16px on the field specifically: iOS Safari zooms the page when a focused
   input is smaller, which throws the layout the moment somebody taps it. */
input {
  width: 100%;
  min-height: 52px;
  padding: 0 16px;
  color: var(--ink);
  background: var(--white);
  border: 1.5px solid var(--line);
  border-radius: 10px;
  font: inherit;
  font-size: 16px;
}

input:focus {
  border-color: var(--blue);
  outline: 3px solid var(--blue);
  outline-offset: 2px;
}

.error {
  margin: 14px 0 0;
  color: #8c2c1a;
  font-size: 14px;
  font-weight: 700;
}
.error:empty { display: none; }

.button {
  width: 100%;
  min-height: 54px;
  margin-top: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 26px;
  color: var(--white);
  background: var(--coral);
  border: 2px solid var(--coral);
  border-radius: 9px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  transition: background .2s ease, border-color .2s ease, transform .2s ease;
}

.button:hover { background: var(--coral-dark); border-color: var(--coral-dark); transform: translateY(-2px); }
.button:disabled { cursor: not-allowed; opacity: .55; transform: none; }

.fine-print {
  margin: 30px 0 0;
  padding-top: 18px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: 13px;
  line-height: 1.5;
}

:focus-visible { outline: 3px solid var(--yellow); outline-offset: 4px; }

@media (prefers-reduced-motion: reduce) {
  .button { transition: none; }
  .button:hover { transform: none; }
}
