/*
  Remindurr design tokens.
  Deliberately terracotta/warm-neutral, NOT the indigo-on-navy/blue palette
  used across our other apps (WatchTracker, SellHelp, Home Gym Timer,
  Project Tracker) or this site's own original blue palette -- picked
  specifically to feel distinct. Every text-bearing color pair here was
  checked against WCAG contrast (4.5:1 body text / 3:1 large text & UI)
  before being picked.
*/

:root[data-theme="light"] {
  --bg: #fbf6f0;
  --surface: #ffffff;
  --surface-muted: #f3ebe1;
  --border: #e8dfd5;

  --text: #2b2320;
  --text-muted: #6b5d52;

  --primary: #c1571f;
  --primary-dark: #a34817;
  --primary-contrast: #ffffff;
  --primary-soft: #f3dcc9;
  --primary-soft-text: #a34817;

  --danger: #c13d3d;
  --danger-bg: #f6dcdc;

  --soon: #b5740e;
  --soon-bg: #f6e6c4;

  --ok: #4c7a5d;
  --ok-bg: #dceae1;

  --radius: 10px;
  --shadow: 0 1px 3px rgba(43, 35, 32, 0.08), 0 1px 2px rgba(43, 35, 32, 0.06);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #211a16;
  --surface: #2e2620;
  --surface-muted: #362c25;
  --border: #4a3d34;

  --text: #f5ede4;
  --text-muted: #c4b6a9;

  --primary: #e2854a;
  --primary-dark: #ee9a63;
  --primary-contrast: #211a16;
  --primary-soft: #4a3323;
  --primary-soft-text: #e2854a;

  --danger: #e9776b;
  --danger-bg: #3a2320;

  --soon: #e8a94a;
  --soon-bg: #3a2f1c;

  --ok: #7fa88c;
  --ok-bg: #2c3a30;

  --radius: 10px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.24);
  color-scheme: dark;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  transition: background-color 0.15s ease, color 0.15s ease;
}

a { color: var(--primary-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

header#app-nav { background: var(--surface); border-bottom: 1px solid var(--border); }
.nav-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}
.nav-inner .brand { font-weight: 700; font-size: 1.15rem; color: var(--text); }
.nav-inner .brand:hover { text-decoration: none; }
.nav-inner nav { display: flex; align-items: center; gap: 18px; }
.nav-inner nav a { color: var(--text-muted); font-weight: 500; }
.nav-inner nav a.active { color: var(--primary-dark); }
.link-btn {
  background: none; border: none; color: var(--text-muted); font-size: 0.95rem;
  cursor: pointer; padding: 0; font-family: inherit;
}
.link-btn:hover { color: var(--danger); text-decoration: underline; }

.theme-toggle-btn {
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text); cursor: pointer; padding: 0; font-size: 1rem;
}
.theme-toggle-btn:hover { background: var(--surface-muted); }

main {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 20px 64px;
}

h1 { font-size: 1.6rem; margin: 0 0 4px; }
h2 { font-size: 1.2rem; margin: 0 0 12px; }
.subtitle { color: var(--text-muted); margin: 0 0 24px; }

.page-header {
  display: flex; align-items: flex-end; justify-content: space-between;
  flex-wrap: wrap; gap: 12px; margin-bottom: 20px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
}

.card + .card { margin-top: 12px; }

.section { margin-bottom: 32px; }

.list { display: flex; flex-direction: column; gap: 10px; }

.item-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow);
}
a.item-row { color: inherit; text-decoration: none; }
a.item-row:hover { border-color: var(--primary); text-decoration: none; }
.item-main { display: flex; flex-direction: column; gap: 2px; }
.item-title { font-weight: 600; }
.item-meta { color: var(--text-muted); font-size: 0.9rem; }
.item-people { font-size: 0.85rem; color: var(--text-muted); }
.item-actions { display: flex; gap: 10px; align-items: center; flex-shrink: 0; }

.badge {
  display: inline-block; font-size: 0.78rem; font-weight: 600;
  padding: 3px 10px; border-radius: 999px; white-space: nowrap;
}
.badge.today { background: var(--danger-bg); color: var(--danger); }
.badge.soon { background: var(--soon-bg); color: var(--soon); }
.badge.later { background: var(--ok-bg); color: var(--ok); }

.badge-type {
  display: inline-block; font-size: 0.72rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.03em;
  background: var(--primary-soft); color: var(--primary-soft-text);
  padding: 2px 8px; border-radius: 6px;
}

.empty-state {
  text-align: center; color: var(--text-muted); padding: 40px 20px;
  border: 1px dashed var(--border); border-radius: var(--radius);
}

form { display: flex; flex-direction: column; gap: 14px; }
.form-row { display: flex; flex-direction: column; gap: 6px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 620px) { .form-grid { grid-template-columns: 1fr; } }

label { font-size: 0.88rem; font-weight: 600; color: var(--text); }
.hint { font-size: 0.8rem; color: var(--text-muted); font-weight: 400; }

input[type="text"], input[type="date"], input[type="number"], input[type="email"],
input[type="password"], textarea, select {
  font: inherit; padding: 9px 12px; border: 1px solid var(--border);
  border-radius: 8px; background: var(--surface); color: var(--text);
}
textarea { resize: vertical; min-height: 70px; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--primary); outline-offset: 1px; }

.checkbox-group { display: flex; flex-wrap: wrap; gap: 10px; }
.checkbox-chip {
  display: flex; align-items: center; gap: 6px; border: 1px solid var(--border);
  border-radius: 999px; padding: 6px 12px; font-size: 0.88rem; cursor: pointer;
  background: var(--surface);
}
.checkbox-chip input { margin: 0; }
.checkbox-chip.checked { border-color: var(--primary); background: var(--primary-soft); }

button, .btn {
  font: inherit; font-weight: 600; padding: 10px 18px; border-radius: 8px;
  border: 1px solid transparent; cursor: pointer; display: inline-flex;
  align-items: center; justify-content: center; gap: 6px;
}
.btn-primary { background: var(--primary); color: var(--primary-contrast); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--surface); border-color: var(--border); color: var(--text); }
.btn-secondary:hover { background: var(--surface-muted); }
.btn-danger { background: var(--danger-bg); color: var(--danger); border-color: transparent; }
.btn-danger:hover { filter: brightness(0.95); }
.btn-small { padding: 6px 12px; font-size: 0.85rem; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }

.auth-wrap {
  max-width: 380px; margin: 10vh auto; padding: 0 20px;
}
.auth-wrap .card { padding: 28px 26px; }
.auth-wrap h1 { text-align: center; }
.auth-wrap .subtitle { text-align: center; }
.auth-toggle { text-align: center; font-size: 0.9rem; margin-top: 6px; }
.error-text { color: var(--danger); font-size: 0.88rem; }
.success-text { color: var(--ok); font-size: 0.88rem; }

.loading { color: var(--text-muted); padding: 20px 0; }

.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.5);
  display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 50;
}
.modal { background: var(--surface); border-radius: var(--radius); padding: 22px; max-width: 480px; width: 100%; box-shadow: var(--shadow); }
