/* OUR — login page.
   Self-contained on purpose: the login screen must render correctly even if
   base.css is unavailable (it sits outside the auth gate). Tokens mirror the
   design system in SPEC.md. */

:root {
  --bg: #FBF6EE;
  --surface: #FFFFFF;
  --ink: #2B2723;
  --muted: #8A8177;
  --line: #EBE3D7;
  --sun-a: #FFD75E;
  --sun-b: #FF9E4A;
  --coral: #FF6B57;
  --radius: 14px;
  --shadow: 0 2px 12px rgba(43, 39, 35, .08);
  --shadow-lift: 0 10px 30px rgba(43, 39, 35, .12);
  --ease: 150ms ease;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px calc(32px + env(safe-area-inset-bottom));
  min-height: 100vh;
  min-height: 100dvh;
  position: relative;
  overflow-x: hidden;
}

/* A warm haze behind everything — the "endless daylight" glow. */
body::before {
  content: "";
  position: fixed;
  inset: -30vh 0 auto 50%;
  transform: translateX(-50%);
  width: min(1100px, 160vw);
  height: 90vh;
  background:
    radial-gradient(closest-side, rgba(255, 215, 94, .40), rgba(255, 215, 94, 0) 70%),
    radial-gradient(closest-side at 65% 55%, rgba(255, 158, 74, .26), rgba(255, 158, 74, 0) 70%);
  pointer-events: none;
  z-index: 0;
}

.stage {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: rise 480ms cubic-bezier(.2, .7, .3, 1) both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- brand ---------- */

.brand {
  text-align: center;
  margin: 0 0 26px;
}

.sun {
  width: 76px;
  height: 76px;
  display: block;
  margin: 0 auto 10px;
  transition: transform 400ms cubic-bezier(.2, .7, .3, 1);
  filter: drop-shadow(0 4px 14px rgba(255, 158, 74, .35));
}

.brand:hover .sun { transform: rotate(22deg) scale(1.04); }

.sun .rays { transform-origin: 60px 60px; }

.wordmark {
  margin: 0;
  font-size: 40px;
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.05;
  background: linear-gradient(135deg, var(--sun-a), var(--sun-b));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

.tagline {
  margin: 6px 0 0;
  font-size: 14px;
  color: var(--muted);
}

/* ---------- card ---------- */

.card {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow-lift);
  padding: 26px 24px 24px;
}

.field { margin: 0 0 16px; }

.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin: 0 0 7px;
  letter-spacing: .01em;
}

.field input {
  width: 100%;
  font: inherit;
  font-size: 16px; /* keeps iOS from zooming on focus */
  color: var(--ink);
  background: #FDFBF7;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  transition: border-color var(--ease), box-shadow var(--ease), background var(--ease);
  appearance: none;
}

.field input::placeholder { color: #C4BCB0; }

.field input:hover { border-color: #DFD5C6; }

.field input:focus {
  outline: none;
  background: var(--surface);
  border-color: var(--sun-b);
  box-shadow: 0 0 0 4px rgba(255, 158, 74, .16);
}

/* ---------- error ---------- */

.error {
  margin: -4px 0 14px;
  font-size: 13.5px;
  font-weight: 500;
  color: #B23A2B;
  background: rgba(255, 107, 87, .10);
  border: 1px solid rgba(255, 107, 87, .28);
  border-radius: 10px;
  padding: 9px 12px;
}

.error[hidden] { display: none; }

/* ---------- button ---------- */

.signin {
  position: relative;
  width: 100%;
  border: 0;
  cursor: pointer;
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  color: #573100;
  background: linear-gradient(135deg, var(--sun-a), var(--sun-b));
  border-radius: 999px;
  padding: 14px 20px;
  box-shadow: 0 6px 18px rgba(255, 158, 74, .34);
  transition: transform var(--ease), box-shadow var(--ease), filter var(--ease);
  -webkit-tap-highlight-color: transparent;
}

.signin:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(255, 158, 74, .42);
  filter: saturate(1.06);
}

.signin:active { transform: translateY(0); box-shadow: 0 4px 12px rgba(255, 158, 74, .34); }

.signin:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(255, 158, 74, .35), 0 6px 18px rgba(255, 158, 74, .34);
}

.signin:disabled { cursor: default; opacity: .8; transform: none; }

.spinner {
  display: none;
  position: absolute;
  top: 50%;
  left: 50%;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  border: 2.5px solid rgba(87, 49, 0, .28);
  border-top-color: #573100;
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

.signin.busy .label { visibility: hidden; }
.signin.busy .spinner { display: block; }

@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- misc ---------- */

.footnote {
  margin: 18px 0 0;
  font-size: 12.5px;
  color: #ADA49A;
  text-align: center;
}

.shake { animation: shake 340ms cubic-bezier(.36, .07, .19, .97) both; }

@keyframes shake {
  10%, 90% { transform: translateX(-1.5px); }
  20%, 80% { transform: translateX(3px); }
  30%, 50%, 70% { transform: translateX(-5px); }
  40%, 60% { transform: translateX(5px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

@media (max-width: 380px) {
  .card { padding: 22px 18px 20px; border-radius: 18px; }
  .wordmark { font-size: 34px; }
  .sun { width: 66px; height: 66px; }
}
