/* Kroger Meal Planner — warm/earthy, food-forward design system.
   Token names below are the source of truth; don't reach for a raw hex
   anywhere else in this file. */
:root {
  --color-bg: #f5efe4;          /* warm parchment/cream */
  --color-surface: #fffdf9;     /* card surfaces, slightly lifted off bg */
  --color-ink: #2a231c;         /* body text — warm near-black, not pure black */
  --color-ink-muted: #7a6f61;   /* secondary/metadata text */
  --color-accent: #c1633e;      /* terracotta/rust — primary actions, key highlights */
  --color-accent-dark: #a24f30; /* accent hover/active */
  --color-anchor: #2b4a3a;      /* warm forest green — header/nav */
  --color-anchor-light: #3d6350;
  --color-border: #e4d9c7;

  /* Day-type tags: two distinct earth-tone families, not one mint pill for everything. */
  --color-training-bg: #f3d9a8;
  --color-training-fg: #7a4a12;
  --color-rest-bg: #cdd9c2;
  --color-rest-fg: #2f4a26;

  /* Dietary/attribute tags: a separate family from day-type, so meaning is scannable by color. */
  --color-attr-bg: #dce3ea;
  --color-attr-fg: #35495c;

  --color-flag-bg: #f0cfc2;
  --color-flag-fg: #8a3419;
  --color-danger: #a3402a;
  --color-danger-dark: #832f1c;
}

* { box-sizing: border-box; }

body {
  font-family: -apple-system, "Segoe UI", Roboto, sans-serif; /* body/metadata: clean sans */
  margin: 0;
  background: var(--color-bg);
  color: var(--color-ink);
  font-size: 17px;
  line-height: 1.5;
}

.container {
  max-width: 980px;
  margin: 0 auto;
  padding: 24px 20px 60px;
}

nav {
  background: var(--color-anchor);
  color: #fff;
  padding: 14px 20px;
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  align-items: center;
}
nav a {
  color: #f2ece0;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
nav a:hover { color: #fff; text-decoration: underline; }
nav .brand {
  font-family: Georgia, "Iowan Old Style", serif;
  font-size: 19px;
  font-weight: 700;
  color: #fff;
  margin-right: 8px;
}

h1, h2, h3, .recipe-name {
  font-family: Georgia, "Iowan Old Style", "Charter", serif;
  font-weight: 700;
  color: var(--color-ink);
}
h1 { font-size: 32px; margin: 6px 0 10px; }
h2 { font-size: 22px; margin-top: 30px; margin-bottom: 12px; }
.recipe-name { font-size: 24px; margin: 2px 0 8px; line-height: 1.25; }

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 14px;
  padding: 20px 22px;
  margin-bottom: 16px;
  box-shadow: 0 2px 6px rgba(43, 33, 20, 0.06);
}

/* Day cards differ visually by day-type — a left accent bar in the matching earth tone,
   not identical regardless of content. */
.day-card { border-left: 6px solid var(--color-rest-fg); }
.day-card.training { border-left-color: var(--color-training-fg); background: #fdf7ec; }
.day-card.rest { border-left-color: var(--color-rest-fg); }

.pill {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.pill.training { background: var(--color-training-bg); color: var(--color-training-fg); }
.pill.rest { background: var(--color-rest-bg); color: var(--color-rest-fg); }
.pill.attr { background: var(--color-attr-bg); color: var(--color-attr-fg); }
.pill.flag { background: var(--color-flag-bg); color: var(--color-flag-fg); }

/* Delivery/pickup nav toggle — two .pill buttons side by side inside a rounded track, living in
   the dark-green nav bar (see partials/header.ejs). Inactive half reads as a subdued option on
   that dark background; active half switches to the same terracotta accent used for primary
   actions elsewhere, so "this is the live choice" reads consistently with the rest of the app. */
.pill-toggle { display: inline-flex; gap: 2px; background: rgba(255,255,255,0.12); border-radius: 999px; padding: 3px; }
.pill-toggle-form { margin: 0; }
.pill.mode-option {
  cursor: pointer;
  border: none;
  background: transparent;
  color: #cfc6b4;
  padding: 4px 13px;
}
.pill.mode-option:hover { color: #fff; }
.pill.mode-option.active { background: var(--color-accent); color: #fff; }

button, input[type=submit], .btn {
  background: var(--color-accent);
  color: #fff;
  border: none;
  padding: 11px 18px;
  border-radius: 9px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: background 0.15s ease;
}
button:hover, .btn:hover { background: var(--color-accent-dark); }
button.secondary, .btn.secondary {
  background: #eee3d1;
  color: var(--color-ink);
}
button.secondary:hover { background: #e2d4bc; }
/* Destructive actions look visually distinct from primary/secondary — never the same gray. */
button.danger, .btn.danger {
  background: transparent;
  color: var(--color-danger);
  border: 1.5px solid var(--color-danger);
}
button.danger:hover { background: var(--color-danger); color: #fff; }

a { color: var(--color-accent-dark); }
a:hover { color: var(--color-accent); }

select, input[type=text], input[type=number], input[type=password], input[type=date] {
  padding: 9px 10px;
  border-radius: 8px;
  border: 1px solid var(--color-border);
  font-size: 15px;
  width: 100%;
  background: #fff;
  color: var(--color-ink);
  font-family: inherit;
}

table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--color-border); }
th { font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--color-ink-muted); }

.muted { color: var(--color-ink-muted); font-size: 14px; }
form.inline { display: inline; }

.login-wrap {
  max-width: 380px;
  margin: 90px auto;
  padding: 28px;
}

/* Scannable stat cluster for macro/cost metadata — replaces one dense gray line. */
.stat-row { display: flex; flex-wrap: wrap; gap: 22px; margin: 10px 0 6px; }
.stat-item { min-width: 70px; }
.stat { font-size: 22px; font-weight: 700; color: var(--color-ink); }
.stat.accent { color: var(--color-accent-dark); }
.stat-label { font-size: 11px; color: var(--color-ink-muted); text-transform: uppercase; letter-spacing: 0.05em; }

.qty-stepper { display: flex; align-items: center; gap: 4px; }
.qty-stepper button {
  padding: 3px 10px;
  font-size: 12px;
  line-height: 1.4;
}
.qty-stepper input[type=number] { text-align: center; padding: 7px 4px; }

/* Signature element: the cost-vs-HungryRoot / weekly-budget comparison meter — a filled bar
   in the accent color against the anchor-tinted track, distinctive to this product's actual
   differentiator (real cost tracking against a real spend target). */
.budget-meter { margin: 10px 0; }
.budget-meter-track {
  background: #e6ddc9;
  border-radius: 999px;
  height: 12px;
  overflow: hidden;
}
.budget-meter-fill {
  background: var(--color-accent);
  height: 100%;
  border-radius: 999px;
}
.budget-meter-fill.over { background: var(--color-danger); }

/* Landing page — matches the approved layout mockup (two-column action grid, dark primary
   card, dashed Quick Add row), ported onto this file's existing token system rather than
   introducing a second one. */
.connection-status { display: flex; gap: 10px; font-size: 13px; flex-wrap: wrap; }
.status-dot {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--color-surface); border: 1px solid var(--color-border); color: var(--color-ink-muted);
  padding: 5px 10px; border-radius: 20px; font-weight: 600;
}
.status-dot .dot { width: 7px; height: 7px; border-radius: 50%; background: #4a9d5f; flex-shrink: 0; }
.status-dot.disconnected .dot { background: var(--color-danger); }

.greeting { font-size: 34px; margin: 6px 0 6px; }
.subgreeting { color: var(--color-ink-muted); font-size: 17px; margin: 0 0 28px; }

.snapshot {
  background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 14px;
  padding: 18px 24px; margin-bottom: 28px; display: flex; align-items: center; gap: 16px;
}
.snapshot-icon {
  width: 40px; height: 40px; border-radius: 50%; background: var(--color-rest-bg);
  display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0;
}
.snapshot-text { color: var(--color-ink-muted); font-size: 16px; }
.snapshot-text strong { color: var(--color-anchor); }

.action-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; margin-bottom: 20px; }
@media (max-width: 720px) { .action-grid { grid-template-columns: 1fr; } }

.action-card { border-radius: 16px; padding: 28px; }
.primary-card { background: var(--color-anchor); color: #fff; }
.primary-card .tag {
  display: inline-block; background: rgba(255,255,255,0.15); color: #e8e2d2;
  font-size: 13px; font-weight: 600; padding: 4px 12px; border-radius: 20px; margin-bottom: 14px;
}
.primary-card h2 { color: #fff; margin: 0 0 8px; font-size: 24px; }
.primary-card p { color: #d9d2c0; font-size: 15px; margin: 0 0 20px; line-height: 1.5; }
.btn-outline {
  background: transparent; border: 1.5px solid rgba(255,255,255,0.45); color: #fff;
  padding: 11px 18px; border-radius: 9px; font-size: 15px; font-weight: 600;
  text-decoration: none; display: inline-block; cursor: pointer;
}
.btn-outline:hover { background: rgba(255,255,255,0.1); color: #fff; }

.secondary-card {
  background: var(--color-surface); border: 1px solid var(--color-border);
  display: flex; flex-direction: column; justify-content: center;
}
.secondary-card h3 { font-size: 19px; margin: 0 0 8px; color: var(--color-ink); }
.secondary-card p { color: var(--color-ink-muted); font-size: 14.5px; margin: 0 0 18px; }

.quickadd-row {
  background: var(--color-surface); border: 1px dashed #d9a98c; border-radius: 14px;
  padding: 18px 24px; display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
}
.quickadd-left { display: flex; align-items: center; gap: 14px; }
.quickadd-icon {
  width: 38px; height: 38px; border-radius: 10px; background: var(--color-training-bg);
  display: flex; align-items: center; justify-content: center; font-size: 17px; flex-shrink: 0;
}
.quickadd-title { font-weight: 700; font-size: 15.5px; }
.quickadd-sub { color: var(--color-ink-muted); font-size: 13.5px; }

.footer-note { text-align: center; color: var(--color-ink-muted); font-size: 13px; margin-top: 36px; }

@media (max-width: 640px) {
  body { font-size: 16px; }
  h1 { font-size: 26px; }
  .container { padding: 16px 14px 40px; }
  .stat-row { gap: 14px; }
}
