:root {
  --bg: #eef1f4;
  --surface: #ffffff;
  --surface-2: #e4e8ec;
  --ink: #1b2430;
  --ink-muted: #5b6774;
  --border: #c9d1d8;
  --accent: #2c4a7c;
  --durante: #b9702f;
  --danger: #a23b3b;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #10151c;
    --surface: #171e27;
    --surface-2: #1e2731;
    --ink: #e7ecf1;
    --ink-muted: #97a3b0;
    --border: #2b3542;
    --accent: #6fa3d8;
    --durante: #e0a868;
    --danger: #d17878;
  }
}
:root[data-theme="dark"] {
  --bg: #10151c; --surface: #171e27; --surface-2: #1e2731; --ink: #e7ecf1;
  --ink-muted: #97a3b0; --border: #2b3542; --accent: #6fa3d8; --durante: #e0a868; --danger: #d17878;
}
:root[data-theme="light"] {
  --bg: #eef1f4; --surface: #ffffff; --surface-2: #e4e8ec; --ink: #1b2430;
  --ink-muted: #5b6774; --border: #c9d1d8; --accent: #2c4a7c; --durante: #b9702f; --danger: #a23b3b;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
}
h1, h2 {
  font-family: Georgia, "Iowan Old Style", "Times New Roman", serif;
  text-wrap: balance;
  margin: 0;
}
.mono {
  font-family: ui-monospace, "SF Mono", Consolas, monospace;
}
button {
  font: inherit;
}
a { color: var(--accent); }

/* ── Auth screen ── */
.auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.auth-card {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 32px 28px;
}
.auth-card .eyebrow {
  font-family: ui-monospace, "SF Mono", Consolas, monospace;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin: 0 0 8px;
}
.auth-card h1 { font-size: 26px; margin-bottom: 22px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label { font-size: 13px; color: var(--ink-muted); }
.field input {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 10px 12px;
  color: var(--ink);
  font-size: 15px;
}
.field input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.btn-primary {
  width: 100%;
  background: var(--ink);
  color: var(--bg);
  border: none;
  border-radius: 5px;
  padding: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 6px;
}
.btn-primary:hover { opacity: 0.9; }
.auth-toggle {
  margin-top: 18px;
  font-size: 13.5px;
  color: var(--ink-muted);
  text-align: center;
}
.auth-toggle button {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}
.error-msg {
  background: color-mix(in srgb, var(--danger) 15%, transparent);
  border: 1px solid var(--danger);
  color: var(--danger);
  border-radius: 5px;
  padding: 8px 12px;
  font-size: 13.5px;
  margin-bottom: 14px;
}

/* ── App shell (post-login) ── */
.app-shell { display: none; max-width: 720px; margin: 0 auto; padding: 32px 20px 80px; }
.app-shell.visible { display: block; }
.app-header {
  display: flex; justify-content: space-between; align-items: baseline;
  border-bottom: 3px solid var(--ink); padding-bottom: 18px; margin-bottom: 28px;
}
.app-header h1 { font-size: 24px; }
.logout-link { background: none; border: none; color: var(--ink-muted); font-size: 13px; cursor: pointer; }

.new-trip {
  display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 28px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 16px;
}
.new-trip input { flex: 1; min-width: 120px; }

.trip-list { display: grid; gap: 12px; }
.trip-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 6px;
  padding: 14px 16px; display: flex; justify-content: space-between; align-items: center;
}
.trip-card .dates { font-family: ui-monospace, "SF Mono", Consolas, monospace; font-size: 12.5px; color: var(--ink-muted); }
.empty-state { color: var(--ink-muted); font-size: 14px; padding: 20px 0; }

.hungry-btn {
  margin-top: 28px;
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--durante); color: #10151c; border: none; border-radius: 999px;
  padding: 10px 18px; font-weight: 600; font-size: 14px; cursor: pointer;
}
.hungry-result {
  margin-top: 14px; font-size: 13.5px; color: var(--ink-muted);
  background: var(--surface-2); border-radius: 6px; padding: 12px 14px;
  white-space: pre-wrap;
}

@media (max-width: 480px) {
  .auth-card { padding: 26px 20px; }
}
