:root {
  --enamel: #F6F9FB;
  --ink: #0E3B43;
  --ink-soft: #46666C;
  --mint: #2FA594;
  --mint-deep: #1F7F72;
  --line: #CAD8DE;
  --paper: #FFFFFF;
  --gum: #E8657A;
  --display: "Unbounded", system-ui, sans-serif;
  --text: "Onest", system-ui, sans-serif;
  --wrap: 1120px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }   /* иначе form { display: grid } перебивает атрибут hidden */
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--enamel);
  color: var(--ink);
  font: 400 17px/1.6 var(--text);
}

a { color: inherit; }
:focus-visible { outline: 3px solid var(--mint); outline-offset: 3px; border-radius: 4px; }

h1, h2, h3 { font-family: var(--display); font-weight: 700; line-height: 1.15; margin: 0; }
h1 { font-size: clamp(32px, 4.3vw, 52px); letter-spacing: -0.01em; }
h2 { font-size: clamp(26px, 3.2vw, 38px); margin-bottom: 12px; }
h3 { font-size: 18px; font-weight: 500; }

.demo-bar {
  background: var(--ink); color: #DDEBEE; font-size: 14px; text-align: center; padding: 8px 16px;
}
.demo-bar a { color: #fff; margin-left: 8px; }

.top {
  max-width: var(--wrap); margin: 0 auto; padding: 20px 24px;
  display: flex; align-items: center; gap: 32px;
}
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--display); font-weight: 700; font-size: 18px; }
.logo svg { width: 30px; height: 30px; fill: var(--paper); stroke: var(--ink); stroke-width: 2; }
.top nav { display: flex; gap: 24px; margin-left: auto; }
.top nav a { text-decoration: none; color: var(--ink-soft); }
.top nav a:hover { color: var(--ink); }

.btn {
  display: inline-block; border: 0; cursor: pointer; text-decoration: none;
  background: var(--mint); color: #fff; font: 600 17px var(--text);
  padding: 15px 28px; border-radius: 999px;
}
.btn:hover { background: var(--mint-deep); }
.btn-small { padding: 10px 20px; font-size: 15px; }
.link { color: var(--ink); font-weight: 500; }

section { max-width: var(--wrap); margin: 0 auto; padding: 72px 24px; }

/* первый экран: текст + напоминание в телефоне */
.hero {
  display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 56px; align-items: center;
  padding-top: 40px;
}
.lead { font-size: 19px; color: var(--ink-soft); max-width: 34em; margin: 24px 0 32px; }
.hero-actions { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }
.facts { list-style: none; padding: 0; margin: 44px 0 0; display: flex; gap: 32px; flex-wrap: wrap; color: var(--ink-soft); font-size: 15px; }
.facts b { color: var(--ink); display: block; font-weight: 600; }

.phone {
  margin: 0; background: #DDEFE9; border: 10px solid var(--ink); border-radius: 36px;
  padding: 16px 14px 18px; max-width: 360px; justify-self: end; width: 100%;
  box-shadow: 0 30px 60px -30px rgba(14, 59, 67, 0.45);
}
.chat-head { display: flex; align-items: center; gap: 10px; background: var(--paper); margin: -16px -14px 14px; padding: 12px 14px; border-radius: 26px 26px 0 0; }
.chat-head small { display: block; color: var(--ink-soft); font-size: 12px; }
.chat-head b { font-size: 15px; }
.ava { width: 36px; height: 36px; border-radius: 50%; background: var(--mint); color: #fff; display: grid; place-items: center; font: 700 13px var(--display); }
.bubble { position: relative; max-width: 88%; padding: 10px 12px 18px; border-radius: 14px; font-size: 15px; line-height: 1.45; margin-bottom: 6px; }
.bubble p { margin: 0; }
.bubble .meta { color: var(--ink-soft); font-size: 13px; margin-top: 4px; }
.bubble time { position: absolute; right: 10px; bottom: 4px; font-size: 11px; color: var(--ink-soft); }
.bubble.in { background: var(--paper); border-bottom-left-radius: 4px; }
.bubble.out { background: #EFFDDE; margin-left: auto; border-bottom-right-radius: 4px; padding-right: 54px; }
.bubble.small { font-size: 14px; }
.buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; max-width: 88%; margin-bottom: 10px; }
.tg-btn { background: rgba(14, 59, 67, 0.55); color: #fff; text-align: center; font-size: 14px; font-weight: 500; padding: 8px; border-radius: 10px; }
.phone figcaption { text-align: center; font-size: 13px; color: var(--ink-soft); margin-top: 12px; }

/* напоминание появляется один раз при загрузке — единственная анимация на странице */
@media (prefers-reduced-motion: no-preference) {
  .phone .bubble, .phone .buttons { opacity: 0; transform: translateY(8px); animation: pop 0.45s ease-out forwards; }
  .phone .bubble.in { animation-delay: 0.3s; }
  .phone .buttons { animation-delay: 0.9s; }
  .phone .bubble.out { animation-delay: 1.6s; }
  .phone .bubble.small { animation-delay: 2.2s; }
}
@keyframes pop { to { opacity: 1; transform: none; } }

/* цены — прайс-лист с точечными линиями */
.sub { color: var(--ink-soft); margin: 0 0 32px; max-width: 40em; }
.price-list { margin: 0; max-width: 760px; }
.price-list div { display: flex; align-items: baseline; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.price-list dt { font-weight: 500; flex: 0 1 auto; }
.price-list dt small { display: block; color: var(--ink-soft); font-weight: 400; font-size: 14px; }
.price-list div::after { content: ""; order: 1; flex: 1; border-bottom: 2px dotted var(--line); transform: translateY(-6px); min-width: 24px; }
.price-list dd { order: 2; margin: 0; font-family: var(--display); font-weight: 500; font-size: 20px; white-space: nowrap; }

/* врачи */
.doc-list { list-style: none; padding: 0; margin: 32px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; }
.doc-list li { display: flex; gap: 18px; align-items: flex-start; }
.mono { flex: none; width: 64px; height: 64px; border-radius: 50%; border: 2px solid var(--ink); display: grid; place-items: center; font: 700 18px var(--display); background: var(--paper); }
.doc-list p { margin: 6px 0 0; color: var(--ink-soft); font-size: 15px; }

/* шаги — настоящая последовательность, поэтому с номерами */
.how { border-top: 1px solid var(--line); }
.steps { list-style: none; counter-reset: s; padding: 0; margin: 32px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; }
.steps li { counter-increment: s; }
.steps li::before { content: counter(s); display: block; font: 700 44px/1 var(--display); color: var(--mint); margin-bottom: 14px; }
.steps p { color: var(--ink-soft); margin: 8px 0 0; }

/* запись */
.book { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: 56px; background: var(--paper); border-radius: 28px; margin-bottom: 72px; border: 1px solid var(--line); }
.book-text p { color: var(--ink-soft); }
form { display: grid; gap: 18px; }
label, legend { font-weight: 500; font-size: 15px; display: grid; gap: 6px; }
input, select {
  font: 400 17px var(--text); color: var(--ink); background: var(--enamel);
  border: 1.5px solid var(--line); border-radius: 12px; padding: 13px 14px; width: 100%;
}
input:focus, select:focus { border-color: var(--mint); outline: none; box-shadow: 0 0 0 3px rgba(47, 165, 148, 0.2); }
fieldset { border: 0; padding: 0; margin: 0; }
.days { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.days label { display: block; }
.days input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.days span { display: block; border: 1.5px solid var(--line); border-radius: 12px; padding: 9px 12px; text-align: center; cursor: pointer; font-weight: 400; min-width: 76px; }
.days span b { display: block; font-weight: 600; }
.days input:checked + span { border-color: var(--mint); background: #E6F5F2; }
.days input:focus-visible + span { outline: 3px solid var(--mint); outline-offset: 2px; }
.consent { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; color: var(--ink-soft); }
.consent input { width: 20px; height: 20px; margin-top: 2px; flex: none; accent-color: var(--mint); }
.hp { position: absolute; left: -9999px; }
.form-error { color: var(--gum); margin: 0; min-height: 1.6em; font-weight: 500; }
.done { grid-column: 2; align-self: center; }
.done .note { color: var(--ink-soft); font-size: 14px; }

.foot { max-width: var(--wrap); margin: 0 auto; padding: 32px 24px 48px; display: flex; justify-content: space-between; gap: 32px; border-top: 1px solid var(--line); color: var(--ink-soft); font-size: 15px; }
.foot b { color: var(--ink); }
.foot p { margin: 4px 0 0; }
.made { max-width: 34em; text-align: right; }

@media (max-width: 860px) {
  .top nav { display: none; }
  .top .btn-small { margin-left: auto; }
  .hero, .book { grid-template-columns: 1fr; gap: 40px; }
  .phone { justify-self: center; }
  .doc-list, .steps { grid-template-columns: 1fr; gap: 28px; }
  .done { grid-column: 1; }
  .foot { flex-direction: column; }
  .made { text-align: left; }
  section { padding: 56px 16px; }
  .top { padding: 16px; }
  .book { border-radius: 20px; margin: 0 16px 56px; padding: 32px 20px; }
}
