:root {
  --ink: #2A1A2E;
  --ink-soft: #6D5C70;
  --fog: #F5F1F3;
  --paper: #FFFFFF;
  --blush: #F0D9DF;
  --peony: #B8456A;
  --peony-dark: #9A3558;
  --sage: #7C8E7A;
  --line: #E4D9DD;
  --radius: 18px;
  --font-head: "Forum", "Georgia", serif;
  --font-body: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--fog);
  color: var(--ink);
  font: 400 16px/1.5 var(--font-body);
  padding-bottom: calc(112px + env(safe-area-inset-bottom));
  -webkit-tap-highlight-color: transparent;
}
button, input { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }

#app { max-width: 560px; margin: 0 auto; padding: 0 16px; }
.screen { padding-top: 16px; }

:focus-visible { outline: 3px solid var(--peony); outline-offset: 2px; }

/* ---------- Верх ---------- */
.hero-arch {
  border-radius: 999px 999px 28px 28px;
  overflow: hidden;
  aspect-ratio: 5 / 5.4;
  background: var(--blush);
}
.hero-arch img { width: 100%; height: 100%; object-fit: cover; object-position: 38% 50%; }
.hero-text { padding: 22px 4px 8px; }
.hero-text h1 {
  font: 400 54px/1 var(--font-head);
  letter-spacing: 0.01em;
}
.hero-text p { margin-top: 10px; color: var(--ink-soft); max-width: 34ch; }

.title { font: 400 30px/1.15 var(--font-head); margin: 4px 0 16px; }

/* ---------- Услуги ---------- */
.cat { margin-top: 26px; }
.cat-photo {
  position: relative;
  height: 112px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--blush);
}
.cat-photo img { width: 100%; height: 100%; object-fit: cover; }
.cat-photo::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(42, 26, 46, .72), rgba(42, 26, 46, 0) 70%);
}
.cat-photo h3 {
  position: absolute; left: 16px; bottom: 12px; z-index: 1;
  font: 400 26px/1.1 var(--font-head);
  color: #fff;
}

.svc-list { margin-top: 8px; display: grid; gap: 8px; }
.svc {
  display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; align-items: center;
  width: 100%; text-align: left;
  background: var(--paper);
  border: 1.5px solid transparent;
  border-radius: 14px;
  padding: 14px 16px;
  cursor: pointer;
  transition: border-color .15s, background-color .15s;
}
.svc .n { font-weight: 600; }
.svc .d { color: var(--ink-soft); font-size: 14px; }
.svc .p { grid-column: 2; grid-row: 1 / span 2; font: 400 21px/1 var(--font-head); white-space: nowrap; }
.svc[aria-pressed="true"] { border-color: var(--peony); background: #FBEFF2; }

/* ---------- Сводка ---------- */
.picked {
  background: var(--paper);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 20px;
  display: grid; gap: 6px;
}
.picked .row { display: flex; justify-content: space-between; gap: 12px; }
.picked .row span:first-child { color: var(--ink-soft); }
.picked .row span:last-child { font-weight: 600; text-align: right; }

.back {
  background: none; border: 0; padding: 8px 0; cursor: pointer;
  color: var(--peony); font-weight: 600;
}
.back::before { content: "\2190"; margin-right: 8px; }

/* ---------- Окна ---------- */
.days { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 12px; margin: 0 -16px; padding-inline: 16px; scrollbar-width: none; }
.days::-webkit-scrollbar { display: none; }
.day {
  flex: 0 0 auto; min-width: 64px;
  background: var(--paper); border: 1.5px solid transparent; border-radius: 14px;
  padding: 10px 8px; text-align: center; cursor: pointer; line-height: 1.2;
}
.day b { display: block; font: 400 24px/1.1 var(--font-head); }
.day small { color: var(--ink-soft); font-size: 13px; }
.day[aria-pressed="true"] { background: var(--ink); color: #fff; }
.day[aria-pressed="true"] small { color: #D9C9DD; }

.times { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 4px; }
.time {
  background: var(--paper); border: 1.5px solid transparent; border-radius: 12px;
  padding: 13px 0; font-weight: 600; cursor: pointer;
}
.time[aria-pressed="true"] { border-color: var(--peony); background: #FBEFF2; color: var(--peony-dark); }

.empty {
  background: var(--paper); border-radius: var(--radius); padding: 24px 20px; text-align: center;
  color: var(--ink-soft);
}
.empty b { display: block; font: 400 22px/1.2 var(--font-head); color: var(--ink); margin-bottom: 6px; }

/* ---------- Форма ---------- */
.field { display: block; margin-bottom: 14px; }
.field span { display: block; font-size: 14px; color: var(--ink-soft); margin-bottom: 6px; }
.field input {
  width: 100%; background: var(--paper);
  border: 1.5px solid var(--line); border-radius: 12px;
  padding: 14px 14px; font-size: 16px;
}
.field input:focus { border-color: var(--peony); outline: none; }

.consent { display: flex; gap: 12px; align-items: flex-start; margin: 20px 0 6px; cursor: pointer; }
.consent input { position: absolute; opacity: 0; width: 24px; height: 24px; }
.consent .box {
  flex: 0 0 24px; height: 24px; border-radius: 7px;
  border: 1.5px solid var(--ink-soft); background: var(--paper);
  display: grid; place-items: center; margin-top: 1px;
}
.consent input:checked + .box { background: var(--peony); border-color: var(--peony); }
.consent input:checked + .box::after {
  content: ""; width: 6px; height: 11px; margin-bottom: 2px;
  border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg);
}
.consent input:focus-visible + .box { outline: 3px solid var(--peony); outline-offset: 2px; }

.error { color: #B3261E; margin-top: 10px; font-weight: 500; }

/* ---------- Готово ---------- */
.done { text-align: center; padding-top: 40px; }
.done .picked { text-align: left; }
.tick { width: 84px; margin: 0 auto 16px; }
.tick svg { width: 100%; fill: none; stroke: var(--peony); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.tick circle { stroke-dasharray: 208; stroke-dashoffset: 208; animation: draw .7s ease-out forwards; }
.tick path { stroke-dasharray: 48; stroke-dashoffset: 48; animation: draw .4s .55s ease-out forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.note { color: var(--ink-soft); max-width: 32ch; margin: 0 auto; }

/* ---------- Нижняя панель ---------- */
.bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
}
.bar > * { max-width: 528px; margin-inline: auto; }
.bar-info { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; color: var(--ink-soft); margin-bottom: 8px; min-height: 21px; }
.bar-info b { color: var(--ink); font-weight: 600; }
.cta {
  display: block; width: 100%;
  background: var(--peony); color: #fff;
  border: 0; border-radius: 14px; padding: 16px; font-weight: 700; cursor: pointer;
  transition: background-color .15s, opacity .15s;
}
.cta:active:not(:disabled) { background: var(--peony-dark); }
.cta:disabled { background: #D9C8CE; color: #fff; cursor: not-allowed; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  .tick circle, .tick path { stroke-dashoffset: 0; }
}
