/* Ciculu Nutrition — dark modern theme */
:root {
  --bg: #0b0f14;
  --bg-elev: #121821;
  --bg-soft: #18212d;
  --border: #243041;
  --text: #e8eef7;
  --muted: #93a0b4;
  --accent: #3dd6c6;
  --accent-2: #7c9cff;
  --accent-dim: rgba(61, 214, 198, 0.14);
  --danger: #ff7b8a;
  --ok: #5ddea0;
  --gym: #ffb020;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  --radius: 16px;
  --radius-sm: 10px;
  --font: "DM Sans", system-ui, sans-serif;
  --display: "Fraunces", Georgia, serif;
  --sidebar: 280px;
}

*, *::before, *::after { box-sizing: border-box; }
html { color-scheme: dark; }
body {
  margin: 0;
  font-family: var(--font);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(61, 214, 198, 0.08), transparent 50%),
    radial-gradient(900px 500px at 100% 0%, rgba(124, 156, 255, 0.08), transparent 45%),
    var(--bg);
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
h1, h2, h3 {
  font-family: var(--display);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
}
h1 { font-size: clamp(1.6rem, 2.5vw, 2.2rem); margin: 0 0 0.4rem; }
h2 { font-size: 1.25rem; margin: 0 0 0.75rem; }
h3 { font-size: 1.05rem; margin: 0 0 0.5rem; }
p { margin: 0 0 0.85rem; }
.muted { color: var(--muted); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); border: 0;
}

/* Shell */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar);
  flex-shrink: 0;
  background: rgba(12, 16, 22, 0.92);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 40;
}
.brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1.1rem 1.1rem 0.75rem;
}
.brand-link { display: flex; gap: 0.75rem; align-items: center; color: inherit; text-decoration: none; }
.brand-logo { border-radius: 10px; }
.brand-name { font-weight: 700; letter-spacing: -0.02em; }
.brand-tag { font-size: 0.72rem; color: var(--muted); line-height: 1.25; max-width: 11.5rem; }
.side-nav { display: flex; flex-direction: column; gap: 0.25rem; padding: 0.5rem 0.75rem; flex: 1; overflow: auto; }
.nav-item {
  display: block;
  padding: 0.7rem 0.85rem;
  border-radius: 12px;
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  border: 1px solid transparent;
}
.nav-item:hover { background: var(--bg-soft); text-decoration: none; }
.nav-item.is-active {
  background: var(--accent-dim);
  border-color: rgba(61, 214, 198, 0.25);
  color: var(--accent);
}
.sidebar-foot { padding: 0.75rem; border-top: 1px solid var(--border); }
.user-chip { display: flex; gap: 0.7rem; align-items: center; margin-bottom: 0.75rem; }
.user-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #041016; font-weight: 700;
}
.user-name { font-weight: 600; font-size: 0.95rem; }
.user-email { font-size: 0.75rem; color: var(--muted); }

.main-wrap { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: rgba(11, 15, 20, 0.7);
  backdrop-filter: blur(10px);
  position: sticky; top: 0; z-index: 20;
}
.topbar-title { font-weight: 600; flex: 1; }
.content { padding: 1.25rem clamp(1rem, 3vw, 2rem) 2rem; flex: 1; max-width: 1200px; width: 100%; margin: 0 auto; }
.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.25rem clamp(1rem, 3vw, 2rem) 2rem;
  color: var(--muted);
  font-size: 0.85rem;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}

.nav-open, .nav-close {
  display: none;
  background: transparent;
  border: 0;
  color: var(--text);
  cursor: pointer;
}
.nav-open { width: 42px; height: 42px; flex-direction: column; justify-content: center; gap: 5px; }
.nav-open span { display: block; height: 2px; background: var(--text); border-radius: 2px; }
.nav-close { font-size: 1.6rem; line-height: 1; }
.nav-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.55); z-index: 30;
}

/* Controls */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  border-radius: 999px;
  padding: 0.55rem 1rem;
  font-weight: 600;
  font-size: 0.92rem;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
}
.btn:hover { text-decoration: none; filter: brightness(1.05); }
.btn-primary {
  background: linear-gradient(135deg, var(--accent), #2bb8aa);
  color: #041016;
}
.btn-secondary {
  background: var(--bg-soft);
  border-color: var(--border);
  color: var(--text);
}
.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}
.btn-block { width: 100%; }
.btn-sm { padding: 0.3rem 0.65rem; font-size: 0.8rem; }

.field { display: flex; flex-direction: column; gap: 0.35rem; font-size: 0.9rem; }
.field span { color: var(--muted); font-weight: 500; }
input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="date"], select, textarea {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 12px;
  padding: 0.7rem 0.85rem;
  font: inherit;
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid rgba(61, 214, 198, 0.35);
  border-color: var(--accent);
}
.stack { display: grid; gap: 0.9rem; }
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.85rem;
}
.field-span { grid-column: 1 / -1; }

.week-switch select {
  min-width: 180px;
  background: var(--bg-soft);
}

/* Cards & panels */
.panel {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow);
}
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.hero, .page-head {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem;
  margin-bottom: 1.25rem; align-items: flex-start;
}
.hero-actions, .filter-row, .chip-row, .quick-links { display: flex; flex-wrap: wrap; gap: 0.55rem; }
.eyebrow { color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.75rem; font-weight: 600; margin-bottom: 0.35rem; }
.lede { color: var(--muted); max-width: 58ch; font-size: 1.02rem; }
.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
.stat {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  display: grid; gap: 0.25rem;
}
.stat-label { color: var(--muted); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; }

.day-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}
.day-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.95rem;
  display: grid;
  gap: 0.55rem;
}
.day-card.is-gym { border-color: rgba(255, 176, 32, 0.35); }
.day-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.5rem; }
.day-head strong { display: block; }
.meal { display: grid; grid-template-columns: 56px 1fr; gap: 0.4rem; font-size: 0.92rem; }
.meal a { color: var(--text); text-decoration: none; }
.meal a:hover { color: var(--accent); }
.meal-time { color: var(--muted); font-size: 0.78rem; padding-top: 0.15rem; }
.meal-id {
  display: inline-block;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.78rem;
  color: var(--accent);
  background: var(--accent-dim);
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  margin-right: 0.25rem;
}
.cuisine-line { font-size: 0.8rem; color: var(--muted); margin: 0.25rem 0 0; }
.badge {
  display: inline-flex; align-items: center;
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--bg-soft);
  color: var(--muted);
  border: 1px solid var(--border);
}
.badge-gym { background: rgba(255, 176, 32, 0.12); color: var(--gym); border-color: rgba(255, 176, 32, 0.3); }

.tile, .recipe-card, .week-row {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s, transform 0.15s;
}
.tile:hover, .recipe-card:hover, .week-row:hover {
  border-color: rgba(61, 214, 198, 0.4);
  text-decoration: none;
  transform: translateY(-1px);
}
.tile { display: grid; gap: 0.25rem; min-width: 140px; flex: 1; }
.tile span, .recipe-card .muted { color: var(--muted); font-size: 0.88rem; }
.quick-links { margin-top: 0.5rem; }
.recipe-grid, .guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.85rem;
}
.recipe-card-top { display: flex; justify-content: space-between; margin-bottom: 0.5rem; }
.recipe-card h3 { font-size: 1.05rem; margin-bottom: 0.35rem; }
.meta-row { display: flex; gap: 0.75rem; color: var(--muted); font-size: 0.85rem; margin-top: 0.6rem; }

.chip {
  display: inline-flex; align-items: center;
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text);
  font-size: 0.88rem;
  text-decoration: none;
}
.chip:hover { border-color: var(--accent); text-decoration: none; }
.chip.is-active { background: var(--accent-dim); border-color: rgba(61,214,198,0.4); color: var(--accent); }

.week-list { display: grid; gap: 0.55rem; }
.week-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.week-row.is-active { border-color: rgba(61,214,198,0.5); background: var(--accent-dim); }

/* Recipe one-pager */
.meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.65rem;
  margin-bottom: 1rem;
}
.meta-grid > div {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.85rem;
}
.two-col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 0.85rem;
}
.ing-list, .method-list, .check-list { margin: 0; padding-left: 1.1rem; }
.ing-list li, .method-list li { margin-bottom: 0.4rem; }
.note-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.85rem;
  margin-top: 0.25rem;
}

/* Shopping */
.shop-list { list-style: none; margin: 0; padding: 0; }
.shop-list li { border-bottom: 1px solid var(--border); }
.shop-list li:last-child { border-bottom: 0; }
.shop-item {
  display: flex; gap: 0.75rem; align-items: flex-start;
  padding: 0.7rem 0.15rem;
  cursor: pointer;
}
.shop-item input { margin-top: 0.25rem; width: 1.1rem; height: 1.1rem; accent-color: var(--accent); }
.shop-body { display: grid; gap: 0.15rem; }
.shop-name { font-weight: 600; }
.shop-qty { color: var(--accent-2); font-size: 0.9rem; }
.shop-list li.is-checked .shop-name { text-decoration: line-through; color: var(--muted); }

.callout, .alert {
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  margin-bottom: 1rem;
  border: 1px solid var(--border);
}
.callout { background: rgba(124, 156, 255, 0.08); border-color: rgba(124, 156, 255, 0.25); }
.alert-success { background: rgba(93, 222, 160, 0.1); border-color: rgba(93, 222, 160, 0.3); color: var(--ok); }
.alert-error { background: rgba(255, 123, 138, 0.1); border-color: rgba(255, 123, 138, 0.3); color: var(--danger); }

.table-wrap { overflow-x: auto; }
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
table.data th, table.data td {
  border-bottom: 1px solid var(--border);
  padding: 0.65rem 0.55rem;
  text-align: left;
  vertical-align: top;
}
table.data th { color: var(--muted); font-weight: 600; }
.menu-table th, .menu-table td { min-width: 110px; }
.menu-table a { color: var(--text); text-decoration: none; }
.menu-table a:hover { color: var(--accent); }

.prose .lead { font-size: 1.08rem; color: var(--muted); }
.prose ul, .prose ol { padding-left: 1.2rem; }
.prose li { margin-bottom: 0.35rem; }
.rhythm {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  overflow: auto;
  font-size: 0.9rem;
  color: var(--accent);
}

.empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--muted);
  background: var(--bg-elev);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

/* Auth */
.auth-layout {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}
.auth-card {
  width: min(420px, 100%);
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 1.75rem;
  box-shadow: var(--shadow);
}
.auth-brand { text-align: center; margin-bottom: 1.25rem; }
.auth-brand img { margin: 0 auto 0.75rem; }
.auth-links { text-align: center; margin-top: 1rem; }
.disclaimer-mini { margin-top: 1.25rem; font-size: 0.75rem; color: var(--muted); text-align: center; }

/* Auth extras */
.auth-card-wide { max-width: 520px; }
.auth-flash { width: min(440px, 100%); margin: 0 auto 1rem; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
@media (max-width: 560px) { .field-row { grid-template-columns: 1fr; } }
.check-line {
  display: flex; gap: 0.65rem; align-items: flex-start;
  font-size: 0.92rem; color: var(--text); line-height: 1.4;
}
.check-line input { margin-top: 0.2rem; accent-color: var(--accent); }
.captcha-demo {
  padding: 0.85rem 1rem; border: 1px solid var(--border);
  border-radius: 12px; background: var(--bg-soft);
}
.tiny { font-size: 0.78rem; }
.auth-links { text-align: center; margin-top: 1rem; }
.auth-links a { color: var(--accent); }

/* Status / onboarding */
.status-panel { max-width: 720px; position: relative; }
.status-panel h1 { font-family: Fraunces, serif; font-size: clamp(1.6rem, 3vw, 2.2rem); margin: 0.25rem 0 0.75rem; }
.status-pill {
  display: inline-block; margin-top: 0.25rem;
  font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.04em;
  padding: 0.15rem 0.45rem; border-radius: 999px;
  background: #2a3548; color: var(--muted);
}
.status-processing { background: rgba(61,214,198,0.15); color: var(--accent); }
.status-onboarding { background: rgba(120,160,255,0.15); color: #9db7ff; }
.nav-hint { padding: 0.5rem 1rem; font-size: 0.8rem; line-height: 1.35; }

.onboard { max-width: 720px; }
.onboard-head { margin-bottom: 1.25rem; }
.progress {
  height: 6px; background: var(--bg-soft); border-radius: 999px; overflow: hidden; margin-top: 1rem;
}
.progress-bar {
  height: 100%; background: linear-gradient(90deg, var(--accent), #6ae0ff);
  border-radius: 999px; transition: width 0.25s ease;
}
.onboard-form .fieldset { border: 0; padding: 0; margin: 0; }
.onboard-form legend { font-size: 0.9rem; color: var(--muted); margin-bottom: 0.5rem; }
.chip-grid { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chip {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.45rem 0.7rem; border-radius: 999px;
  border: 1px solid var(--border); background: var(--bg-soft);
  cursor: pointer; font-size: 0.88rem;
}
.chip:has(input:checked) {
  border-color: var(--accent); background: rgba(61,214,198,0.12); color: var(--accent);
}
.chip input { accent-color: var(--accent); }
.form-actions {
  display: flex; justify-content: space-between; align-items: center;
  gap: 1rem; margin-top: 0.5rem; padding-top: 0.5rem;
}
.steps-list { margin: 0; padding-left: 1.2rem; color: var(--muted); line-height: 1.6; }
.demo-box { border: 1px dashed rgba(61,214,198,0.35); }
.pulse-ring {
  width: 56px; height: 56px; border-radius: 50%;
  border: 2px solid var(--accent); opacity: 0.5;
  animation: pulse 1.6s ease-out infinite;
  margin-bottom: 1rem;
}
@keyframes pulse {
  0% { transform: scale(0.85); opacity: 0.7; }
  100% { transform: scale(1.25); opacity: 0; }
}
.h3 { font-size: 1.05rem; margin: 0; font-weight: 600; }
.meta-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
}
.meta-grid dt { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.meta-grid dd { margin: 0.15rem 0 0; font-weight: 600; }

/* Mobile */
@media (max-width: 900px) {
  .sidebar {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    transform: translateX(-105%);
    transition: transform 0.2s ease;
  }
  .sidebar.is-open { transform: translateX(0); }
  .nav-open, .nav-close { display: inline-flex; }
  .content { padding-top: 1rem; }
}

/* Print */
@media print {
  body { background: #fff; color: #111; }
  .sidebar, .topbar, .site-footer, .hero-actions, .nav-open, .btn, .week-switch { display: none !important; }
  .main-wrap, .content { max-width: none; padding: 0; }
  .panel, .day-card, .recipe-card, .meta-grid > div {
    box-shadow: none;
    border-color: #ccc;
    background: #fff;
    break-inside: avoid;
  }
  a { color: #111; text-decoration: none; }
  .print-section { break-inside: avoid; }
}
