/* CasaCeff — clean, quick-reading base styles. Light and dark aware. */
[hidden] { display: none !important; }
:root {
  --bg: #f7f5f0;
  --surface: #ffffff;
  --text: #1f2421;
  --muted: #67706b;
  --line: #e3dfd6;
  --accent: #2f5d50;
  --accent-text: #ffffff;
  --danger: #a3392b;
  --radius: 14px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141716;
    --surface: #1d2120;
    --text: #ecefed;
    --muted: #9aa39e;
    --line: #2d3331;
    --accent: #6fb59f;
    --accent-text: #0f1311;
    --danger: #e0806f;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.55 var(--font);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--accent); }

/* ---- header ---- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: max(14px, env(safe-area-inset-top)) 20px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.brand { font-weight: 700; font-size: 1.25rem; text-decoration: none; color: var(--text); letter-spacing: -0.01em; }
.brand span { color: var(--accent); }
.usernav { display: flex; gap: 18px; }
.usernav a { text-decoration: none; color: var(--muted); font-size: 0.95rem; }
.usernav a:hover { color: var(--text); }

/* ---- layout ---- */
.page { width: 100%; max-width: 44rem; margin: 0 auto; padding: 28px 20px 48px; flex: 1; }
.footer { text-align: center; color: var(--muted); font-size: 0.8rem; padding: 20px; }
h1 { font-size: 1.7rem; line-height: 1.2; margin: 0 0 20px; letter-spacing: -0.02em; }
h2 { font-size: 1.15rem; margin: 0 0 4px; }
p { margin: 0 0 14px; }

/* ---- home cards ---- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; position: relative;
}
.card p { color: var(--muted); font-size: 0.93rem; margin: 0; }
.card.soon { opacity: 0.7; }
.badge {
  display: inline-block; margin-top: 12px; font-size: 0.75rem; font-weight: 600;
  color: var(--muted); border: 1px solid var(--line); border-radius: 99px; padding: 2px 10px;
}

/* ---- messages ---- */
.messages { list-style: none; padding: 0; margin: 0 0 20px; }
.msg { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent);
  border-radius: 10px; padding: 10px 14px; margin-bottom: 8px; }
.msg.error { border-left-color: var(--danger); }

/* ---- forms (login, 2FA and account pages) ---- */
form { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; margin: 0 0 18px; }
form p, form > div { margin: 0 0 14px; }
label { display: block; font-weight: 600; font-size: 0.92rem; margin-bottom: 6px; }
input[type=text], input[type=password], input[type=email], input[type=number], input:not([type]), select, textarea {
  width: 100%; font: inherit; color: var(--text); background: var(--bg);
  border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
input[type=checkbox] { width: 20px; height: 20px; vertical-align: middle; margin-right: 8px; accent-color: var(--accent); }
label:has(input[type=checkbox]) { display: flex; align-items: center; font-weight: 500; }
button, input[type=submit], .button {
  display: inline-block; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none;
  background: var(--accent); color: var(--accent-text); border: 0; border-radius: 10px;
  padding: 12px 20px; min-height: 46px; margin: 4px 8px 4px 0;
}
button[name=action_remove], button.danger { background: var(--danger); }
.helptext, .help-block, small { display: block; color: var(--muted); font-size: 0.85rem; margin-top: 4px; }
.errorlist { color: var(--danger); padding-left: 18px; margin: 6px 0; font-size: 0.9rem; }
hr { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }
table { width: 100%; border-collapse: collapse; margin-bottom: 18px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); }
code, pre { font-size: 0.92rem; }
img[alt*="QR"], svg { background: #fff; padding: 8px; border-radius: 10px; max-width: 220px; height: auto; }

/* ================================================================ shared bits */
a.card { display: block; text-decoration: none; color: inherit; transition: border-color .15s, transform .15s; }
a.card:hover { border-color: var(--accent); transform: translateY(-1px); }
.muted { color: var(--muted); font-size: 0.9rem; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.page-head h1 { margin: 0; }
.button.small { padding: 8px 14px; min-height: 0; font-size: 0.9rem; }
.back { display: inline-block; color: var(--muted); text-decoration: none; font-size: 0.92rem; margin-bottom: 10px; }
.empty { color: var(--muted); text-align: center; padding: 40px 0; }
ul.plain { list-style: none; padding: 0; margin: 0 0 22px; }
ul.plain li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.usernav a:first-child { color: var(--text); font-weight: 600; }

/* ================================================================ recipe list */
form.filters { padding: 14px; margin: 16px 0 18px; }
form.filters input[type=search] { width: 100%; margin-bottom: 10px; font: inherit; color: var(--text);
  background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.filter-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }
.filter-row:last-child { margin-bottom: 0; }
.filter-row select { flex: 1 1 140px; width: auto; padding: 10px 12px; }
.filter-row button { margin: 0 0 0 auto; padding: 10px 18px; min-height: 0; }
label.check { display: flex; align-items: center; font-weight: 500; margin: 0; }
.clear { font-size: 0.9rem; }
.recipe-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.recipe-row { display: block; text-decoration: none; color: var(--text); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.recipe-row:hover { border-color: var(--accent); }
.r-title { display: block; font-weight: 650; font-size: 1.08rem; margin-bottom: 4px; }
.r-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--muted); font-size: 0.88rem; }
.cleanup.light { color: var(--accent); }
.cleanup.heavy { color: var(--danger); }

/* ================================================================ recipe page */
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: -6px 0 14px; }
.chip { font-size: 0.85rem; background: var(--surface); border: 1px solid var(--line); border-radius: 99px; padding: 3px 11px; }
.chip.accent { border-color: var(--accent); color: var(--accent); }
.lede { font-size: 1.05rem; color: var(--muted); }
.tabs { position: sticky; top: 0; z-index: 5; display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 4px; margin: 18px 0 22px; }
.tabs button { margin: 0; background: transparent; color: var(--muted); padding: 10px 6px; min-height: 42px; border-radius: 9px; }
.tabs button[aria-selected=true] { background: var(--accent); color: var(--accent-text); }
.tab-panel h2 { margin-top: 22px; margin-bottom: 8px; }
.servings { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.servings strong { font-size: 1.3rem; min-width: 1.5em; text-align: center; }
button.round { width: 40px; height: 40px; min-height: 0; padding: 0; border-radius: 50%; margin: 0; font-size: 1.3rem; line-height: 1; }
.ingredients .qty { font-weight: 600; }
ol.method { padding-left: 1.3em; margin: 0 0 22px; }
ol.method li { margin-bottom: 14px; padding-left: 4px; }
ol.method p { margin: 0 0 2px; }
.meta-links { display: flex; gap: 18px; font-size: 0.92rem; margin-top: 26px; }
button.wide { width: 100%; margin: 22px 0 0; font-size: 1.05rem; min-height: 54px; }
button.secondary { background: var(--surface); color: var(--text); border: 1px solid var(--line); }
button.link { background: none; color: var(--muted); padding: 8px 0; min-height: 0; font-weight: 500; text-decoration: underline; }
button:disabled { opacity: 0.4; cursor: default; }

/* get it out */
.progress-text { color: var(--muted); }
ul.checklist { list-style: none; padding: 0; margin: 0 0 18px; }
ul.checklist li { display: flex; gap: 12px; align-items: center; padding: 13px 12px; margin-bottom: 6px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; user-select: none; -webkit-tap-highlight-color: transparent; }
ul.checklist .box { flex: none; width: 24px; height: 24px; border: 2px solid var(--line); border-radius: 7px; }
ul.checklist li.done { opacity: 0.5; }
ul.checklist li.done > span:last-child { text-decoration: line-through; }
ul.checklist li.done .box { background: var(--accent); border-color: var(--accent); }
ul.checklist li.done .box::after { content: "✓"; display: block; color: var(--accent-text); text-align: center; font-weight: 700; line-height: 20px; }

/* cook mode */
.cook-status { display: flex; justify-content: space-between; font-weight: 600; margin-bottom: 8px; }
#cook-clock { font-variant-numeric: tabular-nums; color: var(--muted); }
.bar { height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; }
.bar-fill { height: 100%; width: 0; background: var(--accent); transition: width .4s; }
#cook-left { margin: 6px 0 14px; }
.step-card { background: var(--surface); border: 2px solid var(--accent); border-radius: 18px; padding: 22px 20px; min-height: 150px; }
.step-card p { font-size: 1.35rem; line-height: 1.45; margin: 0 0 14px; }
.step-card.waiting { border-style: dashed; }
.step-card.ring { animation: ring 1s ease-in-out infinite; }
@keyframes ring { 50% { border-color: var(--danger); box-shadow: 0 0 0 6px color-mix(in srgb, var(--danger) 25%, transparent); } }
#cook-timer { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
#timer-display { font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.step-nav { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; margin: 14px 0 8px; }
.step-nav button { margin: 0; min-height: 56px; font-size: 1.05rem; }
ol.timeline { list-style: none; padding: 0; margin: 0 0 10px; border-left: 2px solid var(--line); }
ol.timeline li { display: flex; gap: 12px; padding: 9px 0 9px 14px; position: relative; cursor: pointer; color: var(--muted); }
ol.timeline li::before { content: ""; position: absolute; left: -7px; top: 15px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--line); }
ol.timeline li.past { opacity: 0.55; }
ol.timeline li.past::before { background: var(--accent); border-color: var(--accent); }
ol.timeline li.now { color: var(--text); font-weight: 600; }
ol.timeline li.now::before { border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent); }
.t-at { flex: none; width: 3.2em; font-variant-numeric: tabular-nums; font-size: 0.85rem; padding-top: 2px; }
#cook-finish { margin-top: 10px; }
#cook-finish label { margin-top: 12px; }
