/* ---------- Tokens ---------- */
:root {
  --bg: #F7F4FB;
  --surface: #FFFFFF;
  --ink: #1F2230;
  --muted: #5D5A6E;
  --border: #DCD3E8;
  --aqua: #4FD1C5;        /* fills: buttons, done days */
  --aqua-ink: #0B3B38;    /* text on aqua */
  --aqua-deep: #0F7A74;   /* aqua as text on light bg */
  --lilac-tint: #F3E6FB;
  --lilac-ring: #A77BC9;
  --lilac-ink: #4A2A66;
  --off: #EEEAF3;
  --missed: #B5652E;
  --missed-ink: #8A4A1F;
  --danger: #9A3F12;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(31,34,48,.06), 0 8px 24px rgba(31,34,48,.06);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15141B;
    --surface: #201E28;
    --ink: #ECEAF2;
    --muted: #A7A3B8;
    --border: #3A3545;
    --aqua-deep: #6FDCD1;
    --lilac-tint: #2D2339;
    --lilac-ring: #B996D6;
    --lilac-ink: #E6D3F7;
    --off: #2A2732;
    --missed: #E08A55;
    --missed-ink: #F2A97A;
    --danger: #F08A5D;
    --shadow: none;
    color-scheme: dark;
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-family: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.4;
}
h1, h2, p { margin: 0; }
a { color: var(--aqua-deep); }
button { font: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--aqua-deep); outline-offset: 2px; }

.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.card { background: var(--surface); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }

/* ---------- Logo ---------- */
.logo {
  width: 28px; height: 28px; border-radius: 9px;
  background: var(--aqua); color: var(--aqua-ink);
  display: grid; place-items: center;
}
.logo svg { width: 60%; height: 60%; }
.logo-lg { width: 64px; height: 64px; border-radius: 20px; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 14px; font-weight: 600; }
input[type="email"], input[type="password"], input[type="text"], input[type="date"] {
  height: 48px; padding: 0 14px; width: 100%;
  border: 1.5px solid var(--border); border-radius: 12px;
  background: var(--surface); color: var(--ink);
  font: inherit; font-size: 16px; /* 16px stops iOS zooming on focus */
}
input:focus-visible { border-color: var(--aqua-deep); outline-offset: 1px; }

.btn {
  height: 52px; padding: 0 20px; border: 0; border-radius: 14px;
  font-size: 17px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  text-decoration: none;
}
.btn-primary { background: var(--aqua); color: var(--aqua-ink); }
.btn-primary:hover { filter: brightness(0.96); }
.btn-block { width: 100%; }

.alert {
  padding: 12px 14px; border-radius: 12px;
  background: var(--lilac-tint); color: var(--lilac-ink);
  font-size: 15px; font-weight: 500;
}

/* ---------- Auth ---------- */
.auth {
  max-width: 420px; margin: 0 auto; min-height: 100dvh;
  padding: 32px 24px; display: flex; flex-direction: column; justify-content: center; gap: 32px;
}
.auth-brand { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.auth-brand h1 { font-size: 32px; font-weight: 700; letter-spacing: -0.02em; }
.auth-form { display: flex; flex-direction: column; gap: 18px; }
.auth .card form { margin-top: 16px; }
.auth-logo { margin: 0; }
.auth-logo img { display: block; width: min(280px, 72vw); height: auto; margin: 0 auto; }
.logo-img { display: block; width: 32px; height: 32px; }