/* Pizza Lab — klimat pizzerii neapolitańskiej: pomidor San Marzano, mozzarella, bazylia, zwęglony rant z pieca */
:root {
  --pomodoro: #b5301f; --pomodoro-deep: #8f2216; --pomodoro-soft: #f6e1d9;
  --basilico: #3f7d3a; --basilico-soft: #e3eedc;
  --crosta: #d9a35b; --crosta-soft: #f3e3c6;
  --carbone: #24160f; --carbone-2: #3a2619;
  --bg: #f8f1e4; --card: #fffcf6; --ink: #2a1c14; --muted: #7d6a5c; --line: #e9dcc7; --field: #fffaf1;
  --accent-ink: #fffaf1;
  --radius: 16px; --shadow: 0 1px 2px rgba(60,30,10,.06), 0 8px 24px -12px rgba(60,30,10,.18);
  --serif: "Fraunces", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1a110c; --card: #24180f; --ink: #f5ead9; --muted: #bba792; --line: #3d2b1e; --field: #1e140d;
    --pomodoro: #e0573f; --pomodoro-deep: #c4432d; --pomodoro-soft: #3b1f17; --basilico: #7fb56f; --basilico-soft: #22301d;
    --crosta-soft: #3a2a17; --accent-ink: #1a110c; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 26px -14px rgba(0,0,0,.6); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #1a110c; --card: #24180f; --ink: #f5ead9; --muted: #bba792; --line: #3d2b1e; --field: #1e140d;
  --pomodoro: #e0573f; --pomodoro-deep: #c4432d; --pomodoro-soft: #3b1f17; --basilico: #7fb56f; --basilico-soft: #22301d;
  --crosta-soft: #3a2a17; --accent-ink: #1a110c; color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; color: var(--ink); font: 16px/1.5 var(--sans); background-color: var(--bg); min-height: 100vh;
  /* delikatny „pył mąki” na tle */
  background-image: radial-gradient(rgba(140,100,60,.07) 1px, transparent 1.2px), radial-gradient(rgba(140,100,60,.05) 1px, transparent 1.2px);
  background-size: 22px 22px, 31px 31px; background-position: 0 0, 11px 17px;
}
a { color: var(--pomodoro); }
h1, h2, h3, .brand-name { font-family: var(--serif); font-optical-sizing: auto; letter-spacing: -.01em; }
h1 { font-size: 2.1rem; line-height: 1.1; margin: .1em 0 .2em; font-weight: 700; }
h2 { font-size: 1.3rem; margin: 0 0 .9em; font-weight: 700; }
h3 { font: 600 .75rem/1.2 var(--sans); margin: 1.4em 0 .6em; color: var(--muted); text-transform: uppercase; letter-spacing: .12em; }
.muted { color: var(--muted); } .small { font-size: .85rem; } .center { text-align: center; } .right { text-align: right; }
.err { color: #c62828; min-height: 1.2em; margin: .4em 0; font-weight: 500; }
.info { background: var(--crosta-soft); border-left: 4px solid var(--crosta); border-radius: 10px; padding: .7em .9em; }
.info.dup { background: var(--basilico-soft); border-color: var(--basilico); }
code { background: var(--crosta-soft); padding: .1em .4em; border-radius: 6px; font-size: 1.05em; }
.eyebrow { font: italic 500 1rem var(--serif); color: var(--pomodoro); margin: 0; }
.back { display: inline-block; color: var(--muted); text-decoration: none; font-size: .9rem; margin-bottom: 6px; }
.back:hover { color: var(--pomodoro); }

/* ---------- nagłówek ---------- */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 10px 16px; background: var(--carbone); color: #f5ead9;
  background-image: radial-gradient(circle at 12% 120%, rgba(217,163,91,.18), transparent 40%), radial-gradient(circle at 90% -40%, rgba(181,48,31,.25), transparent 45%); }
.logo { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.logo img { filter: drop-shadow(0 2px 4px rgba(0,0,0,.35)); }
.wordmark { display: flex; flex-direction: column; line-height: 1; }
.wm-name { font: 700 1.35rem var(--serif); letter-spacing: -.01em; }
.wm-name em { color: var(--crosta); font-weight: 500; }
.wm-tag { font: italic 500 .72rem var(--serif); color: #cdb89e; margin-top: 3px; letter-spacing: .04em; }
.top nav { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.top nav a:not(.btn), .top nav .link { color: #d9c7b0; text-decoration: none; font-weight: 500; font-size: .95rem; }
.top nav a:not(.btn):hover, .top nav .link:hover { color: #fff; }
.top nav a.active:not(.btn) { color: #fff; box-shadow: 0 2px 0 var(--crosta); }
.stripe { display: flex; height: 4px; }
.stripe i { flex: 1; } .stripe i:nth-child(1) { background: var(--basilico); } .stripe i:nth-child(2) { background: #fbf4e4; } .stripe i:nth-child(3) { background: var(--pomodoro); }
.top[hidden] + .stripe { display: none; }
main { max-width: 1120px; margin: 0 auto; padding: 22px 16px 40px; }

/* ---------- elementy ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; box-shadow: var(--shadow); }
.card.narrow { max-width: 420px; margin: 6vh auto; }
.head-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.count { font: 500 1rem var(--sans); color: var(--muted); vertical-align: middle; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 46px; padding: 0 18px; border-radius: 999px;
  border: 1.5px solid var(--line); background: var(--card); color: var(--ink); font: 600 .98rem var(--sans); text-decoration: none; cursor: pointer;
  transition: transform .08s, box-shadow .15s, background .15s; -webkit-tap-highlight-color: transparent; }
.btn:hover { border-color: var(--muted); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--pomodoro); border-color: var(--pomodoro); color: var(--accent-ink); box-shadow: 0 6px 16px -8px rgba(181,48,31,.8); }
.btn.primary:hover { background: var(--pomodoro-deep); border-color: var(--pomodoro-deep); }
.top .btn.primary { box-shadow: none; }
.btn.small { min-height: 38px; padding: 0 14px; font-size: .9rem; }
.btn.wide { width: 100%; }
.btn.danger-ghost { color: #c62828; }
.btn:disabled { opacity: .6; cursor: progress; }
.link { background: none; border: 0; padding: 0; color: var(--pomodoro); font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

label { display: flex; flex-direction: column; gap: 6px; font-size: .88rem; font-weight: 500; color: var(--muted); }
label.full { grid-column: 1 / -1; }
input, select, textarea { font: 400 1.02rem var(--sans); color: var(--ink); background: var(--field); border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 12px; min-height: 48px; width: 100%; transition: border-color .15s, box-shadow .15s; }
textarea { line-height: 1.45; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--pomodoro); box-shadow: 0 0 0 3px var(--pomodoro-soft); }
input::placeholder, textarea::placeholder { color: #b5a391; }
form.card label, .card form label { margin-bottom: 12px; }
.unit { color: var(--muted); font-weight: 400; opacity: .85; }
.req { color: var(--pomodoro); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 2px 16px; align-items: end; }
.grid > label { margin-bottom: 12px; }

/* tytuł sekcji: 01 Ciasto · Impasto */
.sec-title { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; padding-bottom: 12px; margin-bottom: 18px; border-bottom: 1px dashed var(--line); }
.sec-title .num { font: 600 .8rem var(--sans); color: var(--accent-ink); background: var(--pomodoro); border-radius: 999px; padding: 3px 9px; letter-spacing: .05em; align-self: center; }
.sec-title em { font-weight: 500; color: var(--muted); font-size: 1rem; }
.group { border-top: 1px solid var(--line); padding-top: 4px; margin-top: 4px; }
.group:first-of-type { border-top: 0; margin-top: 0; padding-top: 0; }
.group h3 { margin-top: 1em; }

/* szybkie przejścia między sekcjami formularza */
.jump { position: sticky; top: 62px; z-index: 10; display: flex; gap: 6px; overflow-x: auto; padding: 8px 0 10px; margin: -4px 0 8px;
  background: linear-gradient(var(--bg) 75%, transparent); scrollbar-width: none; }
.jump::-webkit-scrollbar { display: none; }
.jump button { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 7px; border: 1.5px solid var(--line); background: var(--card); color: var(--ink);
  border-radius: 999px; padding: 7px 14px 7px 8px; font: 600 .9rem var(--sans); cursor: pointer; }
.jump button span { background: var(--crosta-soft); color: var(--pomodoro); border-radius: 999px; padding: 1px 7px; font-size: .75rem; }
.jump button:hover { border-color: var(--pomodoro); }
section[id^="sec-"] { scroll-margin-top: 120px; }

/* wyliczenia procentów */
.ratios { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.ratios > div { background: var(--crosta-soft); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; }
.ratios > div.accent { background: var(--pomodoro-soft); }
.ratios span { font-size: .75rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.ratios strong { font: 700 1.75rem/1.15 var(--serif); margin-top: 2px; font-variant-numeric: tabular-nums; }
.ratios.live { margin-top: 8px; padding: 14px; border-radius: 16px; background: var(--carbone); }
.ratios.live > div { background: rgba(255,255,255,.07); }
.ratios.live span { color: #cdb89e; } .ratios.live strong { color: #fff6e6; }
.ratios.live p { grid-column: 1 / -1; margin: 0; color: #cdb89e; }
.card.ratios { padding: 14px; }

/* oceny 1–5 */
.rating { border: 0; padding: 0; margin: 0 0 14px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.rating legend { color: var(--ink); margin-bottom: 6px; width: 100%; font: 600 1.05rem var(--serif); }
.rating label { flex-direction: row; }
.rating input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.rating span { display: inline-flex; width: 48px; height: 48px; align-items: center; justify-content: center; border: 1.5px solid var(--line); border-radius: 50%; color: var(--ink);
  font: 700 1.05rem var(--serif); cursor: pointer; background: var(--field); transition: .12s; -webkit-tap-highlight-color: transparent; }
.rating span:hover { border-color: var(--pomodoro); }
.rating input:checked + span { background: var(--pomodoro); color: var(--accent-ink); border-color: var(--pomodoro); box-shadow: 0 4px 10px -4px rgba(181,48,31,.8); }
.rating input:focus-visible + span { outline: 3px solid var(--pomodoro-soft); }
.grid.ratings { grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.stars { color: var(--pomodoro); letter-spacing: 2px; font-size: 1.1rem; } .stars .off { color: var(--line); }

/* dodatki */
.topping { display: grid; grid-template-columns: 1fr 96px auto auto; gap: 8px; align-items: center; margin-bottom: 8px; }
.topping .link { text-decoration: none; font-size: 1.1rem; width: 40px; height: 40px; border-radius: 50%; }
.topping .link:hover { background: var(--pomodoro-soft); }

/* zdjęcia w formularzu */
.photo-slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.slot { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; padding: 10px; border: 1.5px dashed var(--line); border-radius: 16px; background: var(--field); }
.slot-img { width: 100%; aspect-ratio: 4 / 3; border-radius: 12px; display: flex; align-items: flex-end; justify-content: center; overflow: hidden; color: var(--muted); font-size: .8rem;
  background: var(--crosta-soft) url(/ikona.svg) center 40% / 34% no-repeat; padding-bottom: 8px; }
.slot-img:has(img) { padding: 0; }
.slot-img span { background: var(--card); padding: 2px 10px; border-radius: 999px; }
.slot-img img { width: 100%; height: 100%; object-fit: cover; }
.slot.busy { opacity: .5; }
.slot strong { font-family: var(--serif); }
.slot label.btn { color: var(--ink); margin: 0; }
.savebar { position: sticky; bottom: 0; z-index: 10; display: flex; gap: 10px; padding: 14px 0 max(14px, env(safe-area-inset-bottom)); background: linear-gradient(transparent, var(--bg) 35%); }
.savebar .btn.primary { min-width: 200px; }

/* ---------- lista ---------- */
.filters { display: grid; grid-template-columns: minmax(200px, 2.2fr) repeat(5, minmax(0, 1fr)) auto; gap: 10px 12px; align-items: end; padding: 16px; }
.filters label { margin: 0; min-width: 0; }
.filters .link { margin-bottom: 14px; }
@media (max-width: 1000px) { .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); } .filters label.grow { grid-column: 1 / -1; } .filters .link { justify-self: start; margin: 0; } }
.bakes { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.bake { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; color: var(--ink); text-decoration: none;
  box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s; }
.bake:hover { transform: translateY(-3px); box-shadow: 0 16px 30px -18px rgba(60,30,10,.45); }
.thumb { position: relative; aspect-ratio: 16 / 10; background: var(--carbone); overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s; }
.bake:hover .thumb img { transform: scale(1.04); }
.thumb.ph { background: radial-gradient(circle at 50% 60%, #4a2f1d 0 22%, var(--carbone) 70%); }
.thumb.ph::before { content: ""; position: absolute; inset: 16% 0; background: url(/ikona.svg) center / contain no-repeat; filter: drop-shadow(0 10px 18px rgba(0,0,0,.5)); }
.score-badge { position: absolute; right: 10px; top: 10px; background: rgba(255,250,241,.95); color: #b5301f; font: 700 .95rem var(--serif); padding: 4px 10px; border-radius: 999px; box-shadow: 0 4px 10px rgba(0,0,0,.2); }
.score-badge.none { color: #7d6a5c; font: 500 .75rem var(--sans); }
.bake-body { padding: 14px 16px 16px; min-width: 0; }
.bake-date { font-size: .75rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.bake-title strong { font: 700 1.4rem/1.25 var(--serif); }
.bake-flour { color: var(--muted); font-size: .9rem; margin-bottom: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 0; }
.stats div { background: var(--crosta-soft); border-radius: 10px; padding: 6px 9px; min-width: 0; }
.stats dt { font-size: .68rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stats dd { margin: 0; font: 700 1.05rem var(--serif); font-variant-numeric: tabular-nums; }
.empty { padding: 40px 20px; }
.empty h2 { margin: .6em 0 .3em; }
.empty p { max-width: 420px; margin: 0 auto 18px; }

/* ---------- szczegóły ---------- */
.dl { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px 18px; margin: 0; }
.dl dt { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.dl dd { margin: 2px 0 0; font-weight: 600; font-size: 1.02rem; }
.photos { display: grid; grid-template-columns: 2fr 1fr; gap: 12px; margin-bottom: 16px; }
.photos figure { margin: 0; position: relative; border-radius: 16px; overflow: hidden; box-shadow: var(--shadow); background: var(--carbone); }
.photos figure:first-child { grid-row: span 2; }
.photos:has(figure:only-child) { grid-template-columns: 1fr; }
.photos a { display: block; height: 100%; }
.photos img { width: 100%; height: 100%; min-height: 150px; object-fit: cover; display: block; }
.photos figure:first-child img { aspect-ratio: 4 / 3; }
.photos figcaption { position: absolute; left: 10px; bottom: 10px; font: italic 500 .9rem var(--serif); color: #fff; background: rgba(36,22,15,.72); padding: 3px 10px; border-radius: 999px; }
.toppings { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.toppings li { background: var(--basilico-soft); border-radius: 999px; padding: 5px 12px; }
.note { white-space: pre-wrap; margin: 0; font-size: 1.02rem; }
.table { width: 100%; border-collapse: collapse; }
.table th { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.table th, .table td { text-align: left; padding: 10px 6px; border-bottom: 1px solid var(--line); }
.table td.right { text-align: right; }

/* ---------- logowanie ---------- */
.hero-login { position: fixed; inset: 0; overflow-y: auto; display: flex; align-items: center; justify-content: center; padding: 24px 16px;
  background: var(--carbone); background-image: radial-gradient(circle at 50% 125%, rgba(217,120,40,.5), transparent 55%), radial-gradient(circle at 15% 10%, rgba(181,48,31,.28), transparent 40%); }
.login-card { margin: 0; width: 100%; max-width: 420px; padding: 28px 24px; }
.brand img { filter: drop-shadow(0 8px 16px rgba(60,30,10,.35)); }
.brand-name { font-size: 2.6rem; margin: .2em 0 0; }
.brand-name em { color: var(--pomodoro); font-weight: 500; }
.brand-tag { color: var(--muted); margin: .2em 0 .8em; }
.rule { display: flex; align-items: center; gap: 10px; margin: 0 0 18px; color: var(--muted); font: italic .85rem var(--serif); }
.rule::before, .rule::after { content: ""; flex: 1; height: 1px; background: var(--line); }

#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); background: var(--carbone); color: #fff6e6; padding: 12px 18px; border-radius: 999px; opacity: 0; transition: .2s; pointer-events: none; z-index: 50; max-width: calc(100% - 32px); font-weight: 500; box-shadow: 0 10px 24px rgba(0,0,0,.25); }
#toast.show { opacity: 1; transform: translateX(-50%); }
#toast.bad { background: #c62828; }

/* ---------- telefon (przy piecu): duże pola, wygodne kciukiem ---------- */
@media (max-width: 640px) {
  body { font-size: 17px; }
  h1 { font-size: 1.75rem; }
  main { padding: 16px 16px 32px; }
  .top { position: static; }
  .top nav { gap: 14px; width: 100%; justify-content: space-between; }
  .top nav .btn { order: -1; flex: 1 0 100%; min-height: 44px; }
  .wm-tag { display: none; }
  .jump { top: 0; }
  section[id^="sec-"] { scroll-margin-top: 64px; }
  .card { padding: 16px; border-radius: 14px; }
  .bakes { grid-template-columns: 1fr; }
  .photos { grid-template-columns: 1fr 1fr; }
  .photos figure:first-child { grid-column: 1 / -1; grid-row: auto; }
  .topping { grid-template-columns: 1fr 76px auto auto; }
  .table { font-size: .85rem; }
  .grid > label:has(textarea), .grid > label:has(input[type=datetime-local]) { grid-column: 1 / -1; }
  .grid.ratings { grid-template-columns: 1fr; }
  .rating { gap: 5px; }
  .rating span { width: 46px; height: 46px; }
  .rating .link { font-size: .8rem; margin-left: 2px; }
  .head-row > .btn.primary { display: none; }
  .savebar .btn { flex: 1; }
  .savebar .btn.primary { min-width: 0; flex: 2; }
  .ratios strong { font-size: 1.5rem; }
}
