/* Lora — canonical app serif, mirrored from src/styles.css. Self-hosted via
   gstatic (CSP fontSrc allows it) with /fonts/lora-*.woff2 as automatic
   fallback. No fonts.googleapis.com stylesheet — that endpoint is blocked
   by style-src 'self' 'unsafe-inline'. */
@font-face {
  font-family: 'Lora';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('https://fonts.gstatic.com/s/lora/v37/0QIvMX1D_JOuMwT7I-NP.woff2') format('woff2'),
       url('/fonts/lora-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Lora';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('https://fonts.gstatic.com/s/lora/v37/0QIvMX1D_JOuMwr7Iw.woff2') format('woff2'),
       url('/fonts/lora-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, 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: 600;
  font-display: swap;
  src: url('https://fonts.gstatic.com/s/lora/v37/0QIvMX1D_JOuMwT7I-NP.woff2') format('woff2'),
       url('/fonts/lora-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Lora';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('https://fonts.gstatic.com/s/lora/v37/0QIvMX1D_JOuMwr7Iw.woff2') format('woff2'),
       url('/fonts/lora-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: #f8f5ef;
  background-image: radial-gradient(ellipse at 15% 10%, rgba(180,140,80,0.05) 0%, transparent 55%),
                    radial-gradient(ellipse at 85% 90%, rgba(140,100,40,0.04) 0%, transparent 55%);
  font-family: 'Lora', Charter, 'Bitstream Charter', 'Sitka Text', Cambria, 'Iowan Old Style', Palatino, Georgia, serif;
  color: #2c2218;
}
form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 300px;
  padding: 32px;
  border: 1px solid rgba(100,70,20,0.12);
  border-radius: 6px;
  background: #ffffff;
  box-shadow: 0 2px 12px rgba(100,70,20,0.06);
}
h1 { font-size: 28px; font-weight: 600; letter-spacing: 0.04em; text-align: center; color: #3d2f10; margin-bottom: 4px; }
p.subtitle { font-size: 13px; text-align: center; color: #6b5a3d; margin-top: -4px; }
input {
  padding: 10px 12px;
  background: #ffffff;
  border: 1px solid #c9b58a;
  border-radius: 4px;
  color: #2c2218;
  font-family: 'Lora', Charter, 'Bitstream Charter', 'Sitka Text', Cambria, 'Iowan Old Style', Palatino, Georgia, serif;
  font-size: 15px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input::placeholder { color: #6b5a3d; opacity: 1; }
input:focus { border-color: #a88a4a; box-shadow: 0 0 0 2px rgba(168,138,74,0.35); }
.field-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #5a4818;
  margin-bottom: 4px;
}
.field-label .req { color: #b83030; margin-left: 2px; }
.field-help {
  font-size: 12px;
  color: #6b5a3d;
  margin-top: 4px;
  line-height: 1.4;
}
button {
  padding: 10px;
  background: rgba(100,70,20,0.08);
  border: 1px solid rgba(100,70,20,0.18);
  border-radius: 4px;
  color: #6b5218;
  font-family: 'Lora', Charter, 'Bitstream Charter', 'Sitka Text', Cambria, 'Iowan Old Style', Palatino, Georgia, serif;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.02em;
}
button:hover { background: rgba(100,70,20,0.14); }
button[type="submit"] {
  min-height: 48px;
  background: #4a3712;
  border-color: #4a3712;
  color: #ffffff;
  font-size: 16px;
  letter-spacing: 0.04em;
  margin-top: 4px;
}
button[type="submit"]:hover { background: #382808; border-color: #382808; }
button[type="submit"]:focus-visible { outline: 2px solid #4a3712; outline-offset: 2px; }
.error { color: #b83030; font-size: 13px; text-align: center; }
.success { color: #2e7d32; font-size: 13px; text-align: center; }
/* Login card secondary links — bumped to ≥44px tap zone on phone so
   "Forgot password?" reads as actionable, not metadata. (Round-1 Tier 1
   #7 + Tier 3 #20 phone polish.) */
.link { font-size: 14px; text-align: center; padding: 8px 0; }
.link a {
  color: #6b5218;
  opacity: 0.85;
  display: inline-block;
  padding: 6px 4px;
}
.link a:hover { opacity: 1; }
/* Login page tabs */
.tabs { display: flex; gap: 6px; margin-bottom: 8px; padding: 4px; background: rgba(100,70,20,0.06); border-radius: 999px; }
.tabs button { flex: 1; padding: 10px 8px; border: 1px solid transparent; background: transparent; color: #6b5218; font-family: 'Lora', Charter, 'Bitstream Charter', 'Sitka Text', Cambria, 'Iowan Old Style', Palatino, Georgia, serif; font-size: 14px; cursor: pointer; border-radius: 999px; opacity: 0.7; font-weight: 600; }
.tabs button:hover:not(.active) { opacity: 1; background: rgba(100,70,20,0.05); }
.tabs button.active { background: #6b5218; color: #ffffff; opacity: 1; border-color: #6b5218; }
.tab-content { display: none; }
.tab-content.active { display: contents; }

/* ── Password field with reveal-toggle ──────────────────────────────
 * The <input> owns its own border, padding, and focus ring — identical
 * to the .auth-input fields above (email, username). The .pw-field
 * wrapper is purely a positioning context for the eye-toggle button,
 * which is absolutely positioned over the input's right edge. The
 * input has padding-right large enough that masked content never runs
 * under the icon, so the typing surface visually matches the username
 * field's full-width typing surface.
 */
.pw-field {
  position: relative;
  width: var(--form-col-width, min(360px, 100%));
  box-sizing: border-box;
}
.pw-field input {
  /* inherits border / background / padding / focus from the global
   * `input { ... }` rules — only width and right-side icon clearance
   * differ from a plain .auth-input. */
  width: 100%;
  padding-right: 48px;
}
.pw-toggle {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  background: transparent;
  border: none;
  padding: 0;
  /* 44px wide — Apple HIG + WCAG 2.1 AAA touch-target minimum width.
   * Height stretches to match the input via top/bottom: 0. */
  min-width: 44px;
  cursor: pointer;
  color: #6b5a3d;
  line-height: 1;
  opacity: 0.75;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.pw-toggle:hover { opacity: 1; }
.pw-toggle:focus-visible {
  outline: 2px solid #6b5a3d;
  outline-offset: -2px;   /* inside the input border so it doesn't disturb the focus ring */
  opacity: 1;
}
.pw-toggle svg { display: block; }

/* Touch + larger viewport overrides — input padding-right grows with
 * the toggle's hit-target so masked content keeps clearance. */
@media (pointer: coarse) {
  .pw-field input { padding-right: 52px; }
  .pw-toggle { min-width: 48px; }
}
@media (orientation: landscape) and (min-width: 1024px) {
  .pw-field input { padding-right: 64px; }
  .pw-toggle { min-width: 56px; }
}

/* Touch devices: pad interactive elements to a 44px floor regardless of viewport. */
@media (pointer: coarse) {
  input { min-height: 48px; padding: 12px 14px; }
  button { min-height: 48px; padding: 12px; }
  .tabs button { min-height: 48px; padding: 12px 8px; }
}

/* Landscape tablet+ (>=1024px wide AND landscape): hero login surface,
   not a desktop modal. Mirrors the typography/touch-target work in
   src/styles.css lines 1850+ for the in-game cards so the front door
   feels like the same app. */
@media (orientation: landscape) and (min-width: 1024px) {
  form {
    width: min(560px, 90vw);
    padding: 48px 56px;
    gap: 18px;
    border-radius: 10px;
  }
  h1 { font-size: 40px; letter-spacing: 0.01em; margin-bottom: 8px; }
  p.subtitle { font-size: 15px; }
  input { font-size: 18px; padding: 16px 18px; min-height: 56px; border-radius: 6px; }
  button { font-size: 18px; padding: 16px; min-height: 56px; border-radius: 6px; }
  button[type="submit"] { font-size: 19px; min-height: 60px; }
  .tabs { gap: 6px; margin-bottom: 12px; padding: 5px; }
  .tabs button { font-size: 16px; padding: 14px 10px; min-height: 52px; border-radius: 999px; }
  .field-label { font-size: 13px; margin-bottom: 6px; }
  .error, .success, .link { font-size: 15px; }
}
