/* ============================================================
   Auth surface (login, password reset/setup, use-app, admin-qr).
   Warm terracotta theme — derived from the gk-login design bundle
   (claude.ai/design handoff), with our brand assets and flows.
   ============================================================ */

/* ── Inter (self-hosted) ───────────────────────────────────── */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/fonts/inter/inter-latin-ext-normal.woff2') format('woff2');
  unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB,
                 U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/fonts/inter/inter-latin-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
                 U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122,
                 U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
  src: url('/fonts/inter/inter-latin-ext-italic.woff2') format('woff2');
  unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB,
                 U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Inter';
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
  src: url('/fonts/inter/inter-latin-italic.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
                 U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122,
                 U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ── Lora (self-hosted) ────────────────────────────────────── */
@font-face {
  font-family: 'Lora';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/lora/lora-latin-ext-400-normal.woff2') format('woff2');
  unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB,
                 U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Lora';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/lora/lora-latin-400-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
                 U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122,
                 U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Lora';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/lora/lora-latin-ext-400-italic.woff2') format('woff2');
  unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB,
                 U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Lora';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/lora/lora-latin-400-italic.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
                 U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122,
                 U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Lora';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/lora/lora-latin-ext-700-normal.woff2') format('woff2');
  unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB,
                 U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Lora';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/lora/lora-latin-700-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
                 U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122,
                 U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --auth-cream:    #fdf4e8;
  --auth-cream-2:  #f6e6cf;
  --auth-accent:   #d4915c;
  --auth-ember:    #a86b3d;
  --auth-slate:    #2c3a4a;
  --auth-ink:      #3a2e22;
  --auth-ink-soft: #6b5640;
  --auth-line:     rgba(168, 107, 61, 0.18);
  --auth-surface:  #fffaf1;
  --auth-radius:   24px;
  --auth-display-font: 'Lora', Georgia, serif;
  --auth-ui-font:      'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

html, body { margin: 0; padding: 0; }
* { box-sizing: border-box; }

body.gk-body {
  font-family: var(--auth-ui-font);
  color: var(--auth-ink);
  background:
    radial-gradient(1200px 800px at 12% 0%, #ffe9c8 0%, transparent 55%),
    radial-gradient(900px 600px at 100% 100%, #f3dcb6 0%, transparent 55%),
    var(--auth-cream);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Stage ---------- */

.gk-stage {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 20px;
  gap: 18px;
}

.gk-card {
  width: 100%;
  max-width: 880px;
  overflow: hidden;
  background: var(--auth-surface);
  position: relative;
  border-radius: calc(var(--auth-radius) + 8px);
  border: 1px solid rgba(168, 107, 61, .14);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, .6) inset,
    0 24px 60px -28px rgba(60, 40, 20, .35),
    0 2px 8px -2px rgba(60, 40, 20, .08);
}
.gk-card::before {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(420px 220px at 80% -10%, rgba(212, 145, 92, 0.18), transparent 60%);
  pointer-events: none;
}

.gk-stage-credit {
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--auth-ink-soft);
  text-transform: uppercase;
  opacity: 0.7;
}

/* ---------- Slides (cross-fade) ---------- */

.gk-slides {
  position: relative;
  display: grid;
}
.gk-slide {
  grid-area: 1 / 1;
  transition: opacity .35s ease, transform .35s ease;
}
.gk-slide[aria-hidden="true"] {
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  position: absolute;
  inset: 0;
}
.gk-slide[aria-hidden="false"] {
  opacity: 1;
  transform: none;
}

/* ---------- Step 1: role ---------- */

.gk-step-role {
  padding: 56px 56px 44px;
  text-align: center;
  position: relative;
}

.gk-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 36px;
}

.gk-mascot {
  width: 96px;
  height: 96px;
  border-radius: 28px;
  background: linear-gradient(160deg, var(--auth-accent), var(--auth-ember));
  display: grid;
  place-items: center;
  box-shadow: 0 18px 32px -14px rgba(168, 107, 61, .55), 0 1px 0 rgba(255, 255, 255, .4) inset;
  margin-bottom: 8px;
  overflow: hidden;
}
.gk-mascot img {
  width: 84px;
  height: 84px;
  display: block;
  object-fit: contain;
}

.gk-station {
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--auth-ember);
  font-weight: 600;
}

.gk-title {
  font-family: var(--auth-display-font);
  font-weight: 400;
  font-size: 40px;
  line-height: 1.1;
  margin: 4px 0 0;
  color: var(--auth-ink);
  letter-spacing: -0.01em;
}
.gk-title-sm {
  font-family: var(--auth-display-font);
  font-weight: 400;
  font-size: 28px;
  line-height: 1.15;
  margin: 0;
  color: var(--auth-ink);
}

.gk-sub {
  margin: 6px 0 0;
  color: var(--auth-ink-soft);
  font-size: 15px;
}

.gk-roles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 8px;
}

.gk-role {
  appearance: none;
  border: 1px solid var(--auth-line);
  background: linear-gradient(180deg, #fffaf1, #fbf0dc);
  border-radius: calc(var(--auth-radius) + 4px);
  padding: 32px 28px 30px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: pointer;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
  position: relative;
  font-family: inherit;
  color: inherit;
  text-decoration: none;
}
.gk-role:hover {
  transform: translateY(-3px);
  border-color: rgba(168, 107, 61, .35);
  box-shadow: 0 22px 40px -22px rgba(60, 40, 20, .35);
}
.gk-role:focus-visible {
  outline: 3px solid color-mix(in oklab, var(--auth-accent), white 40%);
  outline-offset: 3px;
}

.gk-role-text h2 {
  font-family: var(--auth-display-font);
  font-weight: 400;
  font-size: 26px;
  margin: 0 0 4px;
  letter-spacing: -0.01em;
}
.gk-role-text p {
  margin: 0;
  color: var(--auth-ink-soft);
  font-size: 14px;
  line-height: 1.45;
}

.gk-role-arrow {
  position: absolute;
  top: 22px;
  right: 22px;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: rgba(168, 107, 61, .08);
  color: var(--auth-ember);
  display: grid;
  place-items: center;
  font-size: 16px;
  transition: transform .25s ease, background .25s ease, color .25s ease;
}
.gk-role:hover .gk-role-arrow {
  transform: translateX(3px);
  background: var(--auth-accent);
  color: #fff8ec;
}

/* ---------- Step 2 forms ---------- */

.gk-step-form {
  padding: 36px 56px 48px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  max-width: 560px;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}

.gk-back {
  align-self: flex-start;
  appearance: none;
  background: transparent;
  border: none;
  color: var(--auth-ink-soft);
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
  padding: 6px 10px 6px 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  text-decoration: none;
}
.gk-back:hover { color: var(--auth-ember); }

.gk-form-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}
.gk-form-header .gk-sub { margin-top: 2px; }

.gk-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-width: 460px;
}

.gk-segment {
  display: flex;
  padding: 4px;
  background: rgba(168, 107, 61, .08);
  border-radius: 999px;
  gap: 2px;
  max-width: 460px;
  width: 100%;
}
.gk-segment-btn {
  appearance: none;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 14px;
  color: var(--auth-ink-soft);
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: background .2s ease, color .2s ease;
  flex: 1;
  text-align: center;
}
.gk-segment-btn.is-active {
  background: var(--auth-surface);
  color: var(--auth-ember);
  box-shadow: 0 1px 2px rgba(60, 40, 20, .12);
  font-weight: 600;
}

.gk-method-panel { display: none; }
.gk-method-panel.is-active { display: flex; flex-direction: column; gap: 18px; }

.gk-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.gk-field-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--auth-ink-soft);
  letter-spacing: 0.02em;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.gk-field-side {
  appearance: none;
  background: transparent;
  border: none;
  color: var(--auth-ember);
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
  padding: 0;
}
.gk-field-side:hover { text-decoration: underline; }

.gk-input {
  appearance: none;
  border: 1px solid var(--auth-line);
  background: #fffaf1;
  border-radius: 14px;
  padding: 14px 16px;
  font-family: inherit;
  font-size: 16px;
  color: var(--auth-ink);
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
  outline: none;
  width: 100%;
}
.gk-input::placeholder { color: #b8a08a; }
.gk-input:focus {
  border-color: var(--auth-accent);
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--auth-accent), white 75%);
  background: #fff;
}
.gk-input--code {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 22px;
  letter-spacing: 0.32em;
  text-align: center;
  text-transform: uppercase;
}

.gk-field-hint {
  font-size: 12.5px;
  color: var(--auth-ink-soft);
  line-height: 1.4;
}

.gk-row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13.5px;
  color: var(--auth-ink-soft);
  flex-wrap: wrap;
}
.gk-link {
  color: var(--auth-ember);
  text-decoration: none;
  font-weight: 500;
  appearance: none;
  background: transparent;
  border: none;
  font-family: inherit;
  cursor: pointer;
  padding: 0;
  font-size: inherit;
}
.gk-link:hover { text-decoration: underline; }

/* ---------- Buttons ---------- */

.gk-btn {
  appearance: none;
  border: none;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  padding: 14px 22px;
  border-radius: 999px;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease, color .2s ease;
  letter-spacing: 0.01em;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.gk-btn-full { width: 100%; }
.gk-btn-primary {
  background: linear-gradient(180deg, var(--auth-accent), var(--auth-ember));
  color: #fff8ec;
  box-shadow: 0 12px 24px -14px rgba(168, 107, 61, .8), 0 1px 0 rgba(255, 255, 255, .35) inset;
}
.gk-btn-primary:hover { transform: translateY(-1px); }
.gk-btn-primary:active { transform: translateY(0); }
.gk-btn-primary:disabled {
  opacity: .6;
  cursor: not-allowed;
  transform: none;
}
.gk-btn-ghost {
  background: rgba(168, 107, 61, .10);
  color: var(--auth-ember);
}
.gk-btn-ghost:hover { background: rgba(168, 107, 61, .18); }

/* ---------- Flash ---------- */

.gk-flash {
  border-radius: 14px;
  padding: 12px 16px;
  font-size: 14px;
  line-height: 1.45;
  border: 1px solid transparent;
}
.gk-flash--success {
  background: #e6efd9;
  color: #4a6224;
  border-color: rgba(74, 98, 36, .18);
}
.gk-flash--error {
  background: #f7e1d6;
  color: #a3431f;
  border-color: rgba(163, 67, 31, .22);
}
.gk-flash--info {
  background: rgba(168, 107, 61, .08);
  color: var(--auth-ember);
  border-color: rgba(168, 107, 61, .18);
}

/* ---------- QR ---------- */

.gk-qr-frame {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 22px;
  border-radius: 22px;
  background: rgba(168, 107, 61, .05);
  border: 1px solid var(--auth-line);
}
.gk-qr-canvas {
  width: 220px;
  height: 220px;
  background: #fff;
  border-radius: 16px;
  display: grid;
  place-items: center;
  padding: 12px;
}
.gk-qr-canvas canvas, .gk-qr-canvas img { display: block; max-width: 100%; height: auto; }
.gk-qr-status {
  font-size: 14px;
  color: var(--auth-ink-soft);
  margin: 0;
  text-align: center;
}
.gk-qr-countdown {
  font-size: 12.5px;
  color: var(--auth-ink-soft);
  margin: 0;
  letter-spacing: 0.05em;
}

/* ---------- Use-App page ---------- */

.gk-use-app {
  padding: 56px 56px 44px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}
.gk-use-app .gk-mascot { margin-bottom: 4px; }
.gk-use-app p { color: var(--auth-ink-soft); margin: 0; line-height: 1.55; max-width: 460px; }
.gk-app-links {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 6px;
}
.gk-app-links img { height: 48px; }

/* ---------- Footer ---------- */

.gk-footer {
  display: flex;
  gap: 14px;
  font-size: 12.5px;
  color: var(--auth-ink-soft);
}
.gk-footer a {
  color: var(--auth-ink-soft);
  text-decoration: none;
}
.gk-footer a:hover { color: var(--auth-ember); text-decoration: underline; }

/* ---------- Store Links ---------- */

.gk-store-links {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 16px;
}
.gk-store-link img {
  display: block;
  height: 44px;
  width: auto;
  opacity: 0.85;
  transition: opacity 0.15s;
}
.gk-store-link:hover img { opacity: 1; }

/* ---------- Responsive ---------- */

@media (max-width: 720px) {
  .gk-step-role { padding: 36px 24px 28px; }
  .gk-step-form { padding: 28px 24px 36px; }
  .gk-use-app { padding: 36px 24px 28px; }
  .gk-roles { grid-template-columns: 1fr; }
  .gk-title { font-size: 32px; }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  .gk-slide, .gk-role, .gk-btn, .gk-input, .gk-segment-btn { transition: none !important; }
}
