@font-face { font-family: "Forum"; src: url("/app/fonts/Forum-Regular.ttf"); font-display: swap; }
@font-face { font-family: "Montserrat"; src: url("/app/fonts/Montserrat-Regular.ttf"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Montserrat"; src: url("/app/fonts/Montserrat-Medium.ttf"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Montserrat"; src: url("/app/fonts/Montserrat-SemiBold.ttf"); font-weight: 600; font-display: swap; }

:root {
  --accent: #c4566b;
  --bg: #fbf4ee;
  --ink: #3b2a26;
  --muted: #8a7670;
  --card: #fffaf6;
  --line: #ecdfd6;
  --r: 18px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--ink);
  font: 15px/1.4 "Montserrat", system-ui, sans-serif;
}
.app { max-width: 520px; margin: 0 auto; min-height: 100dvh; display: flex; flex-direction: column; }

/* шапка */
.top { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px 4px; }
.brand-name { font: 26px/1 "Forum", serif; letter-spacing: .02em; }
.brand-sub { color: var(--muted); font-size: 12px; margin-top: 3px; }
.steps-dots { display: flex; gap: 5px; }
.steps-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--line); transition: .3s; }
.steps-dots i.on { background: var(--accent); width: 18px; border-radius: 4px; }

/* торт */
.stage { position: sticky; top: 0; z-index: 2; background: linear-gradient(var(--bg) 80%, transparent); padding: 0 12px; }
.cake { height: min(36vh, 260px); display: grid; place-items: center; }
.cake svg { height: 100%; width: auto; max-width: 100%; overflow: visible; }
.cake.is3d { display: block; height: min(40vh, 300px); margin: 0 -12px; cursor: grab; }
.cake.is3d canvas { display: block; }
.cake.is3d:active { cursor: grabbing; }
.cake-hint { font: 20px "Forum", serif; fill: var(--muted); }
.cake-text { font: 17px "Forum", serif; }
.cake-badge { font: 600 13px "Montserrat"; fill: var(--accent); }
.drop-in { animation: drop .5s cubic-bezier(.3,1.5,.6,1) both; }
@keyframes drop { from { transform: translateY(-40px); opacity: 0; } to { transform: none; opacity: 1; } }
.cake-body { transform-origin: 160px 220px; }
.cake.pop .cake-body { animation: pop .35s ease; }
@keyframes pop { 40% { transform: scale(1.04, .97); } }

/* панель шагов */
.panel { flex: 1; padding: 6px 18px 120px; }
.step-title { font: 28px/1.1 "Forum", serif; margin: 6px 0 4px; }
.step-sub { color: var(--muted); margin: 0 0 16px; font-size: 13px; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.list { display: grid; gap: 10px; }

.opt {
  position: relative; text-align: left; border: 1.5px solid var(--line); background: var(--card);
  border-radius: var(--r); padding: 14px; font: inherit; color: inherit; cursor: pointer; transition: .2s;
}
.opt:active { transform: scale(.98); }
.opt.on { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.opt-title { font-weight: 600; }
.opt-note { color: var(--muted); font-size: 12px; margin-top: 2px; }
.opt-price { color: var(--accent); font-weight: 600; font-size: 13px; margin-top: 6px; }
.opt .sw { width: 26px; height: 26px; border-radius: 50%; border: 1px solid rgba(0,0,0,.08); float: right; margin-left: 8px; }
.opt .sw.naked { background: repeating-linear-gradient(0deg, #f6e3c8 0 5px, #e46a7a 5px 7px); }
.opt.row { display: flex; gap: 12px; align-items: center; }
.opt.row .grow { flex: 1; }
.chk { width: 22px; height: 22px; border-radius: 7px; border: 1.5px solid var(--line); flex: none; display: grid; place-items: center; }
.opt.on .chk { background: var(--accent); border-color: var(--accent); }
.opt.on .chk::after { content: ""; width: 10px; height: 5px; border: 2px solid #fff; border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px,-1px); }

/* счётчик */
.counter { display: flex; align-items: center; justify-content: center; gap: 20px; margin: 18px 0 8px; }
.counter button { width: 52px; height: 52px; border-radius: 50%; border: 1.5px solid var(--line); background: var(--card); font-size: 26px; color: var(--ink); cursor: pointer; }
.counter .val { min-width: 110px; text-align: center; }
.counter .num { font: 44px/1 "Forum", serif; }
.counter .lbl { color: var(--muted); font-size: 12px; }
.kg-line { text-align: center; color: var(--muted); }
.kg-line b { color: var(--ink); }
.kg-adj { display: flex; justify-content: center; gap: 8px; margin-top: 10px; }
.chip { border: 1.5px solid var(--line); background: var(--card); border-radius: 30px; padding: 7px 14px; font: inherit; font-size: 13px; color: var(--ink); cursor: pointer; }

/* поля */
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.field input, .field textarea, .field select {
  width: 100%; border: 1.5px solid var(--line); background: var(--card); border-radius: 14px;
  padding: 13px 14px; font: inherit; color: var(--ink); outline: none;
}
.field input:focus, .field textarea:focus { border-color: var(--accent); }
.field textarea { min-height: 80px; resize: vertical; }
.err { color: #b3261e; font-size: 12px; margin-top: 5px; }
.slots { display: flex; flex-wrap: wrap; gap: 8px; }
.slots .chip.on, .seg .chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.seg { display: flex; gap: 8px; margin-bottom: 14px; }
.seg .chip { flex: 1; padding: 12px; }

.photo { border: 1.5px dashed var(--line); border-radius: var(--r); padding: 18px; text-align: center; color: var(--muted); cursor: pointer; display: block; }
.photo img { max-width: 100%; max-height: 180px; border-radius: 12px; display: block; margin: 0 auto 8px; }
.photo input { display: none; }

/* итог */
.summary { background: var(--card); border: 1.5px solid var(--line); border-radius: var(--r); padding: 6px 16px; }
.summary .ln { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.summary .ln:last-child { border: 0; }
.summary .ln.total { font-weight: 600; font-size: 16px; }
.summary .ln span:first-child { color: var(--muted); }
.note { font-size: 12px; color: var(--muted); margin-top: 12px; }

/* нижняя панель */
.bar {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 0; width: 100%; max-width: 520px;
  display: flex; align-items: center; gap: 10px; padding: 12px 14px calc(12px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-top: 1px solid var(--line);
}
.price { flex: 1; text-align: center; }
.price-label { font-size: 11px; color: var(--muted); }
.price-sum { font: 26px/1.1 "Forum", serif; }
.btn { border: 0; background: var(--accent); color: #fff; font: 600 15px "Montserrat"; padding: 15px 22px; border-radius: 16px; cursor: pointer; min-width: 112px; }
.btn.ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--line); min-width: 0; }
.btn:disabled { opacity: .45; }
.btn.ghost[hidden] { display: block; visibility: hidden; }

/* готово */
.done { text-align: center; padding-top: 10px; }
.done .big { font: 34px/1.1 "Forum", serif; margin: 6px 0 8px; }
.done .num { display: inline-block; background: var(--card); border: 1.5px solid var(--line); border-radius: 30px; padding: 6px 16px; margin: 8px 0 14px; font-weight: 600; }

.demo-banner { background: var(--ink); color: #fff; font-size: 12px; line-height: 1.35; text-align: center; padding: 8px 14px; }
