:root {
  --navy: #1B365D;
  --navy-ink: #10233F;
  --gold: #B8860B;
  --cream: #FFFBF3;
  --paper: #FFFFFF;
  --ink: #111111;
  --muted: #3A3A3A;
  --line: #1A1A1A;
  --gap-bg: #8B1A1A;
  --shadow: 0 2px 0 #111111;
  --radius: 14px;
  --touch: 52px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --bg: var(--cream);
  --card: var(--paper);
  --header-bg: var(--navy);
  --header-fg: #FFFFFF;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { height: 100%; }
body {
  min-height: 100%;
  font-family: var(--font);
  font-size: 18px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--header-bg);
  color: var(--header-fg);
  padding: max(12px, env(safe-area-inset-top)) 16px 16px;
  border-bottom: 3px solid #000;
}
.header-row { display: flex; align-items: center; gap: 10px; }
.brand { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.brand-mark {
  width: 40px; height: 40px;
  border-radius: 8px;
  background: var(--navy-ink);
  flex-shrink: 0;
}
.brand-text h1 {
  margin: 0;
  font-size: 1.15rem;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: 0.01em;
}
.data-stamp {
  margin: 2px 0 0;
  font-size: 0.85rem;
  color: #F0E6C8;
  font-weight: 600;
}

.login-main {
  padding: 28px 16px 40px;
  max-width: 520px;
  margin: 0 auto;
}
.login-card {
  background: var(--card);
  border: 3px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 20px 24px;
}
.page-title {
  margin: 0 0 6px;
  font-size: 1.7rem;
  font-weight: 800;
}
.page-lead {
  margin: 0 0 18px;
  color: var(--muted);
  font-weight: 500;
}
.login-error {
  margin: 0 0 16px;
  padding: 12px 14px;
  border: 3px solid var(--gap-bg);
  border-radius: 12px;
  background: #FDECEC;
  font-weight: 700;
}
.login-label {
  display: block;
  margin: 12px 0 6px;
  font-size: 0.85rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.login-card input[type="email"],
.login-card input[type="password"] {
  width: 100%;
  min-height: 56px;
  font: inherit;
  font-size: 1.1rem;
  font-weight: 600;
  padding: 10px 16px;
  border: 3px solid #000;
  border-radius: 12px;
  background: #FFF;
  color: #111;
  outline: none;
}
.login-card input:focus { box-shadow: 0 0 0 3px var(--gold); }
.login-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 56px;
  margin-top: 22px;
  padding: 10px 16px;
  background: var(--navy);
  color: #FFF;
  font: inherit;
  font-size: 1.15rem;
  font-weight: 800;
  border: 3px solid #000;
  border-radius: 12px;
  cursor: pointer;
}
.login-submit:active { transform: translateY(1px); }
.app-footer {
  padding: 16px 16px max(20px, env(safe-area-inset-bottom));
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
}
.app-footer p { margin: 0; }

@media (min-width: 820px) {
  .login-main { padding-top: 48px; }
}

.login-info {
  margin: 0 0 16px;
  padding: 12px 14px;
  border: 3px solid var(--navy);
  border-radius: 12px;
  background: #EEF2F7;
  font-weight: 700;
}
.login-card input[name="code"] {
  letter-spacing: 0.35em;
  font-size: 1.4rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.login-secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 56px;
  margin-top: 12px;
  padding: 10px 16px;
  background: #FFF;
  color: var(--navy);
  font: inherit;
  font-size: 1.05rem;
  font-weight: 800;
  border: 3px solid #000;
  border-radius: 12px;
  cursor: pointer;
}
.login-textbtn {
  display: block;
  width: 100%;
  margin-top: 14px;
  padding: 10px;
  min-height: 44px;
  background: none;
  border: 0;
  color: var(--navy);
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
}
