/* =========================================================
   Темы
   По умолчанию тёмная — iPhone 17 Pro: Deep Blue (фон) + Cosmic Orange (акцент).
   Светлая — тёплый молочный + пудровый (включается кнопкой в шапке).
   ========================================================= */
:root {
  --bg: #0F1724;
  --bg-glow: #1D2B42;
  --surface: #18243A;
  --surface-2: #213049;
  --text: #EEF1F6;
  --muted: #9AA6B8;
  --line: #2A3A55;
  --accent: #FF7A2F;
  --accent-hover: #FF8F4F;
  --accent-soft: rgba(255, 122, 47, .14);
  --on-accent: #1A0F08;
  --danger: #FF6B6B;
  --shadow: 0 14px 40px -16px rgba(0, 0, 0, .6);
  --backdrop: rgba(4, 8, 16, .6);
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #FBF6F3;
  --bg-glow: #F3E3DC;
  --surface: #FFFFFF;
  --surface-2: #F5EEEA;
  --text: #221C1A;
  --muted: #7A6E69;
  --line: #EADFD9;
  --accent: #B8646A;
  --accent-hover: #A2545A;
  --accent-soft: #F6E4E3;
  --on-accent: #FFFFFF;
  --danger: #C23B3B;
  --shadow: 0 10px 30px -12px rgba(80, 40, 30, .18);
  --backdrop: rgba(34, 28, 26, .35);
  color-scheme: light;
}

/* ========================================================= База */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }
[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100dvh;
  font-family: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 85% -10%, var(--bg-glow), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  transition: background-color .3s, color .3s;
}

h1, h2, h3 { margin: 0; line-height: 1.15; font-weight: 600; }
h1, h2 { font-family: "Cormorant Garamond", Georgia, serif; }
a { color: inherit; }
svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

main, .topbar, .footer {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left));
  padding-right: max(16px, env(safe-area-inset-right));
}

/* ========================================================= Шапка */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: max(16px, env(safe-area-inset-top));
  padding-bottom: 8px;
}

.logo {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 24px;
  font-weight: 600;
  text-decoration: none;
  letter-spacing: .02em;
}

.theme-toggle, .icon-btn {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: border-color .2s, transform .2s;
}
.theme-toggle:hover, .icon-btn:hover { border-color: var(--accent); }
.theme-toggle svg, .icon-btn svg { width: 20px; height: 20px; }

.icon-sun { display: none; }
:root[data-theme="light"] .icon-sun { display: block; }
:root[data-theme="light"] .icon-moon { display: none; }

/* ========================================================= Hero */
.hero {
  padding: clamp(40px, 9vw, 110px) 0 clamp(40px, 7vw, 80px);
  text-align: center;
}

.eyebrow {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--accent);
}

.hero h1 { font-size: clamp(38px, 7.5vw, 76px); }

.lead {
  max-width: 520px;
  margin: 18px auto 32px;
  font-size: clamp(16px, 2vw, 18px);
  color: var(--muted);
}

/* ========================================================= Кнопки */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 24px;
  border: 1px solid transparent;
  border-radius: 999px;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .2s, border-color .2s, transform .15s, opacity .2s;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .55; cursor: default; }

.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }

.btn-ghost { background: var(--surface); border-color: var(--line); color: var(--text); }
.btn-ghost:hover { border-color: var(--accent); }

.btn-xl {
  min-height: 60px;
  padding: 0 56px;
  font-size: 18px;
  letter-spacing: .02em;
  box-shadow: 0 12px 30px -10px color-mix(in srgb, var(--accent) 60%, transparent);
}

.btn-block { width: 100%; }

/* ========================================================= Быстрые кнопки */
.quick {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  max-width: 560px;
  margin: 40px auto 0;
}

.quick-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 6px 14px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: border-color .2s, transform .2s;
}
.quick-item:hover { border-color: var(--accent); transform: translateY(-2px); }

.quick-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
}
.quick-icon svg { width: 22px; height: 22px; fill: currentColor; stroke: none; }
.quick-icon svg.stroke { fill: none; stroke: currentColor; }

/* ========================================================= Секции */
.prices { padding: 32px 0; }
.prices h2 {
  margin-bottom: 20px;
  font-size: clamp(30px, 4.5vw, 42px);
  text-align: center;
}

.price-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.price-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
}
.price-name { font-weight: 600; }
.price-dur { font-size: 14px; color: var(--muted); }
.price-val { font-weight: 700; color: var(--accent); white-space: nowrap; }

.price-skeleton {
  height: 74px;
  background: linear-gradient(90deg, var(--surface), var(--surface-2), var(--surface)) !important;
  background-size: 200% 100% !important;
  animation: shimmer 1.2s infinite linear;
}
@keyframes shimmer { to { background-position: -200% 0; } }

.footer {
  padding-top: 32px;
  padding-bottom: max(32px, env(safe-area-inset-bottom));
  font-size: 14px;
  color: var(--muted);
  text-align: center;
}

/* ========================================================= Окно записи */
.sheet {
  width: min(560px, 100%);
  max-width: 100%;
  max-height: min(820px, calc(100dvh - 48px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--bg);
  color: var(--text);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.sheet[open] { display: flex; flex-direction: column; animation: pop .25s ease-out; }
.sheet::backdrop { background: var(--backdrop); backdrop-filter: blur(4px); }
@keyframes pop { from { opacity: 0; transform: translateY(16px) scale(.98); } }

.sheet-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}
.sheet-title { flex: 1; text-align: center; }
.sheet-title h2 { font-size: 26px; }
.icon-btn { flex: none; width: 40px; height: 40px; }
.sheet-title h2:focus { outline: none; }

.steps { display: flex; justify-content: center; gap: 6px; margin-top: 8px; }
.steps i { width: 22px; height: 4px; border-radius: 4px; background: var(--line); transition: background-color .25s; }
.steps i.on { background: var(--accent); }

.sheet-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 20px max(24px, env(safe-area-inset-bottom));
  overscroll-behavior: contain;
}

.step h3 { font-size: 20px; margin-bottom: 14px; }
.step-note { margin: -6px 0 16px; font-size: 14px; color: var(--muted); }

/* Услуги */
.options { display: grid; gap: 10px; }
.option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color .2s, background-color .2s;
}
.option:hover { border-color: var(--accent); }
.option.selected { border-color: var(--accent); background: var(--accent-soft); }

/* Даты */
.month-label { margin-bottom: 10px; font-weight: 600; text-transform: capitalize; }
.days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}
.day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 10px 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  color: inherit;
  font: inherit;
  cursor: pointer;
  transition: border-color .2s, background-color .2s;
}
.day small { font-size: 11px; color: var(--muted); text-transform: uppercase; }
.day b { font-size: 18px; }
.day:hover:not(:disabled) { border-color: var(--accent); }
.day.selected { border-color: var(--accent); background: var(--accent); color: var(--on-accent); }
.day.selected small { color: inherit; opacity: .8; }
.day:disabled { opacity: .35; cursor: default; background: transparent; }
.day-spacer { visibility: hidden; }

/* Время */
.times {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: 8px;
}
.time {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: inherit;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .2s, background-color .2s;
}
.time:hover { border-color: var(--accent); }
.time.selected { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }

.empty, .loading { padding: 24px 0; text-align: center; color: var(--muted); }

/* Подтверждение */
.summary {
  display: grid;
  gap: 8px;
  margin-bottom: 20px;
  padding: 16px 18px;
  border-radius: 18px;
  background: var(--surface-2);
}
.summary-row { display: flex; justify-content: space-between; gap: 12px; }
.summary-row span:first-child { color: var(--muted); }
.summary-row span:last-child { font-weight: 600; text-align: right; }

.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field span { font-size: 14px; font-weight: 500; color: var(--muted); }
.field input {
  width: 100%;
  min-height: 52px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 16px; /* 16px — чтобы iOS не зумил поле */
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field input.invalid { border-color: var(--danger); }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.form-error { min-height: 20px; margin: 0 0 10px; font-size: 14px; color: var(--danger); }

/* Готово */
.done { text-align: center; }
.done .summary { text-align: left; }
.done-mark {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  margin: 8px auto 16px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
}
.done-mark svg { width: 36px; height: 36px; stroke-width: 2.4; }
.done-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ========================================================= Планшет */

/* ========================================================= Телефон */
@media (max-width: 600px) {
  .price-list { grid-template-columns: 1fr; }
  .quick { gap: 8px; }
  .quick-item { padding: 12px 2px; border-radius: 16px; font-size: 12px; }
  .btn-xl { width: 100%; }

  /* Окно записи — нижний лист на весь экран */
  .sheet {
    width: 100%;
    height: calc(100vh - 24px);
    height: calc(100dvh - 24px);
    max-height: none;
    margin: 0;
    top: auto;
    bottom: 0;
    border-radius: 24px 24px 0 0;
    border-bottom: 0;
  }
  .sheet[open] { animation: slide-up .3s ease-out; }
  @keyframes slide-up { from { transform: translateY(100%); } }

  .days { gap: 6px; }
  .day { padding: 8px 0; border-radius: 12px; }
  .day b { font-size: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
