/* Посадочная «частный мастер». Мобильная версия — основная, десктоп — с 960px. */
:root {
  --bg: #f5f2ee;
  --card: #ffffff;
  --ink: #2a1f1a;
  --ink-soft: #5b4a41;
  --muted: #8a7b72;
  --line: #e7e0d8;
  --opt: #f4f1ed;
  --opt-hover: #ece7e1;
  --accent: #e2502f;
  --accent-dark: #c5411f;
  --accent-soft: #fdeee9;
  --ok: #2e9e5b;
  --radius: 22px;
  --radius-s: 14px;
  --shadow: 0 1px 2px rgba(42, 31, 26, .04), 0 12px 32px rgba(42, 31, 26, .08);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.5 Inter, system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
b, strong { font-weight: 700; }
img { max-width: 100%; display: block; }
a { color: inherit; }
button, input { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.page {
  max-width: 560px;
  margin: 0 auto;
  padding: 20px 16px 28px;
}

/* ---------- Первый экран ---------- */
.hero__title {
  margin: 0;
  font-size: clamp(26px, 7.2vw, 34px);
  line-height: 1.12;
  font-weight: 800;
  letter-spacing: -.02em;
}
.hero { --fw: clamp(140px, 42vw, 200px); } /* ширина фигуры мастера */
.hero__title span { white-space: nowrap; }
.hero__sub {
  margin: 8px 0 0;
  font-size: 16px;
  line-height: 1.4;
  color: var(--ink-soft);
  padding-right: calc(var(--fw) * .9); /* справа — голова мастера */
  min-height: calc(var(--fw) * .43 - 20px);
}
.hero__sub b { color: var(--ink); }

.hero__master {
  position: relative;
  display: flex; flex-direction: column; align-items: flex-start; gap: 10px;
  margin-top: 16px;
  padding: 20px 0 18px 10px;
  background: #ebe5de;
  border-radius: var(--radius);
}
.bubble {
  position: relative; z-index: 1;
  margin: 0;
  padding: 14px 16px;
  background: rgba(255, 255, 255, .95);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  border-radius: 18px;
  box-shadow: var(--shadow);
  font-size: 15px;
  line-height: 1.45;
  color: var(--ink-soft);
}
.bubble b { color: var(--ink); }
.bubble--first { width: calc(100% - var(--fw) * .52); padding-top: 22px; border-bottom-left-radius: 6px; }
.bubble--first::before {
  content: '“';
  position: absolute; left: 14px; top: -2px;
  font: 800 44px/1 Georgia, 'Times New Roman', serif;
  color: var(--accent);
}
.bubble--second { width: calc(100% - 16px); border-top-left-radius: 6px; }

/* фигура мастера: голова выступает над плашкой, низ обрезается её краем */
.hero__photo {
  position: absolute; right: 0; bottom: 0; top: 0;
  width: var(--fw);
  margin: 0;
  clip-path: inset(-200px 0 0 -200px round 0 0 var(--radius) 0); /* режем только снизу и справа */
  pointer-events: none;
}
.hero__photo img { position: absolute; top: 10px; right: 0; width: 100%; height: auto; max-width: none; transform: translateY(-23%); } /* лицо занимает верхние 24% кадра — оно целиком над плашкой */ /* привязка к правому краю: увеличенная фигура не создаёт горизонтальной прокрутки */
/* фигура всегда достаёт до низа плашки: если плашка выше фото, фото увеличивается */
@supports (height: 1cqh) {
  .hero__photo { container-type: size; }
  .hero__photo img { width: auto; height: max(calc((100cqh - 10px) / .77), 188.4cqw); }
}

/* ---------- Призыв и квиз ---------- */
.calc { margin-top: 26px; }
.calc__title {
  margin: 0;
  font-size: clamp(22px, 6vw, 28px);
  line-height: 1.25;
  font-weight: 800;
  letter-spacing: -.01em;
  color: var(--accent);
}
.calc__title mark {
  background: var(--accent); color: #fff;
  padding: 2px 10px 4px; border-radius: 8px;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
.calc__title span { display: inline-block; margin-top: 4px; }
.calc__sub { margin: 10px 0 0; font-size: 16px; color: var(--ink-soft); }
.calc__sub b { color: var(--ink); }

.quiz {
  margin-top: 18px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 16px 20px;
  scroll-margin-top: 12px;
}
.quiz__head {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 28px; margin-bottom: 10px;
}
.quiz__count { margin-left: auto; font-size: 13px; color: var(--muted); }
.quiz__count b { color: var(--ink); }
.quiz__back {
  display: inline-flex; align-items: center; gap: 4px;
  margin: -8px 0 -8px -8px; padding: 8px 10px 8px 6px;
  border: 0; background: none; border-radius: 10px;
  font-size: 14px; font-weight: 500; color: var(--ink-soft); cursor: pointer;
}
.quiz__back:hover { background: var(--opt); color: var(--ink); }
.quiz__progress { height: 6px; border-radius: 6px; background: var(--line); overflow: hidden; }
.quiz__progress span {
  display: block; height: 100%; width: 14%;
  background: var(--accent); border-radius: 6px;
  transition: width .35s ease;
}

.step { display: none; min-width: 0; margin: 0; padding: 0; border: 0; }
.step.is-active { display: block; animation: step-in .25s ease both; }
@keyframes step-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.step:focus { outline: none; }
.step__title {
  display: block; width: 100%;
  margin: 0; padding: 22px 0 16px;
  font-size: 21px; line-height: 1.25; font-weight: 700; letter-spacing: -.01em;
}
.step__desc { margin: -4px 0 16px; color: var(--ink-soft); }
.step__desc b { color: var(--ink); }
.step__hint { margin: 16px 0 10px; font-size: 14px; font-weight: 600; color: var(--muted); }
.step__footer { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }

.options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.options > .opt:last-child:nth-child(odd), .opt--wide { grid-column: 1 / -1; }
.opt {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  min-height: 58px; padding: 12px 10px 12px 12px;
  background: var(--opt);
  border: 2px solid transparent; border-radius: var(--radius-s);
  font-size: 16px; font-weight: 500; line-height: 1.25;
  cursor: pointer; user-select: none;
  transition: background .15s, border-color .15s;
  -webkit-tap-highlight-color: transparent;
}
.opt:hover { background: var(--opt-hover); }
.opt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.opt span { display: flex; align-items: center; gap: 10px; min-width: 0; overflow-wrap: break-word; }
.opt span::before {
  content: ''; flex: none;
  width: 22px; height: 22px;
  border: 2px solid var(--accent); border-radius: 50%;
  background: #fff;
  transition: box-shadow .15s, background .15s, border-color .15s;
}
.opt--check span::before { border-color: #c9c0b8; border-radius: 7px; }
.opt:has(input:checked) { background: var(--accent-soft); border-color: var(--accent); }
.opt input:checked + span::before { box-shadow: inset 0 0 0 5px #fff; background: var(--accent); border-color: var(--accent); }
.opt--check input:checked + span::before {
  box-shadow: none;
  background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='m3.5 8.5 3 3 6-7' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 16px no-repeat;
}
.opt:has(input:focus-visible) { outline: 3px solid rgba(226, 80, 47, .35); outline-offset: 2px; }

.field { position: relative; display: block; margin-bottom: 10px; }
.field__input {
  width: 100%; height: 58px; padding: 0 16px;
  border: 2px solid var(--line); border-radius: var(--radius-s);
  background: #fff; font-size: 18px; font-weight: 500;
  outline: none; transition: border-color .15s, box-shadow .15s;
}
.field__input::placeholder { color: #b3a79e; font-weight: 400; }
.field__input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(226, 80, 47, .15); }
.field__input.is-invalid, .field__input.animate__heartBeat { border-color: var(--accent); animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.field__unit { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 500; pointer-events: none; }

.consent { display: flex; align-items: flex-start; gap: 10px; margin-top: 12px; font-size: 14px; color: var(--ink-soft); cursor: pointer; }
.consent input { flex: none; width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--accent); }
.consent a { color: var(--accent-dark); text-underline-offset: 2px; }
.form-error { margin: 12px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-dark); font-size: 14px; font-weight: 500; }

.btn {
  display: flex; align-items: center; justify-content: center;
  width: 100%; min-height: 58px; padding: 12px 20px;
  border: 0; border-radius: var(--radius-s);
  background: var(--accent); color: #fff;
  font-size: 17px; font-weight: 700; cursor: pointer;
  transition: background .15s, transform .05s;
}
.btn:hover { background: var(--accent-dark); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 3px solid rgba(226, 80, 47, .4); outline-offset: 2px; }
.btn:disabled { background: #d5cdc6; color: #fff; cursor: not-allowed; }

/* Спасибо */
.is-done .quiz__head { visibility: hidden; height: 0; min-height: 0; margin: 0; }
.is-done .quiz__progress span { width: 100% !important; background: var(--ok); }
.done__check { display: grid; place-items: center; width: 52px; height: 52px; margin-top: 22px; border-radius: 50%; background: var(--ok); }
.step--done .step__title { padding-top: 14px; }
.done__links { display: grid; gap: 10px; margin-top: 4px; }
.msg {
  display: flex; align-items: center; gap: 12px;
  min-height: 60px; padding: 12px 16px; border-radius: var(--radius-s);
  color: #fff; font-size: 16px; font-weight: 700; line-height: 1.25; text-decoration: none;
}
.msg span { flex: 1; min-width: 0; }
.msg__ico, .msg__arrow { flex: none; }
.msg--max { background: linear-gradient(90deg, #7b4df3, #17b7ff); }
.msg--max .msg__arrow { color: #2f8df5; }
.msg--tg { background: #1d9bdc; }
.msg--tg .msg__arrow { color: #1d9bdc; }
.msg:hover { filter: brightness(1.06); }

/* ---------- О мастере и подвал ---------- */
.about { margin-top: 26px; }
.about__text { margin: 0; font-size: 17px; line-height: 1.5; color: var(--ink-soft); }
.about__text b { color: var(--ink); }
.about__facts { display: grid; gap: 8px; margin: 16px 0 0; padding: 0; list-style: none; }
.about__facts li {
  position: relative; padding: 12px 14px 12px 44px;
  background: rgba(255, 255, 255, .7); border: 1px solid var(--line); border-radius: var(--radius-s);
  font-size: 14px; line-height: 1.35; color: var(--ink-soft);
}
.about__facts li::before {
  content: ''; position: absolute; left: 14px; top: 14px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='m4 8.5 2.5 2.5L12 5.5' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 14px no-repeat;
}
.about__facts b { display: block; font-size: 15px; color: var(--ink); }

.footer {
  display: flex; flex-wrap: wrap; gap: 4px 16px;
  margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--line);
  font-size: 13px; color: var(--muted);
}
.footer a { display: inline-block; padding: 12px 0; margin: -12px 0; text-underline-offset: 2px; }

/* ---------- Страница политики ---------- */
.page.page--doc { display: block; max-width: 760px; }
.doc__back { display: inline-flex; align-items: center; gap: 6px; padding: 10px 0; font-size: 15px; font-weight: 500; color: var(--accent-dark); text-decoration: none; }
.doc__back:hover { text-decoration: underline; }
.doc { margin-top: 8px; padding: 20px 18px 24px; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow-wrap: break-word; }
.doc h1 { margin: 0 0 6px; font-size: clamp(24px, 6vw, 32px); line-height: 1.15; font-weight: 800; letter-spacing: -.02em; }
.doc__date { margin: 0 0 14px; font-size: 14px; color: var(--muted); }
.doc p, .doc li { margin: 12px 0; font-size: 16px; line-height: 1.6; color: var(--ink-soft); }
.doc p strong { display: block; margin-top: 26px; font-size: 18px; color: var(--ink); }
.doc ul { margin: 12px 0; padding-left: 22px; }
.doc a { color: var(--accent-dark); text-underline-offset: 2px; }
@media (min-width: 480px) { .doc { padding: 32px 36px 36px; } }

/* ---------- Узкие телефоны ---------- */
@media (max-width: 359px) {
  .page { padding-left: 12px; padding-right: 12px; }
  .quiz { padding-left: 12px; padding-right: 12px; }
  .bubble { font-size: 14px; padding: 12px 12px; }
  .bubble--first { padding-top: 20px; }
  .opt { font-size: 14px; padding-left: 10px; padding-right: 6px; }
  .opt span { gap: 8px; }
  .step__title { font-size: 19px; }
}

/* ---------- Планшет ---------- */
@media (min-width: 480px) {
  .page { padding: 28px 20px 36px; }
  .hero { --fw: 210px; }
  .hero__master { padding: 22px 0 22px 14px; }
  .bubble { font-size: 16px; padding: 16px 18px; }
  .bubble--first { padding-top: 24px; }
  .quiz { padding: 24px 24px 26px; }
  .about__facts { grid-template-columns: repeat(3, 1fr); }
  .about__facts li { padding: 44px 14px 14px; }
}

/* ---------- Десктоп: мастер слева, квиз справа ---------- */
@media (min-width: 960px) {
  .page {
    max-width: 1120px; padding: 56px 32px 40px;
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 480px);
    grid-template-areas: 'hero calc' 'about calc' 'footer footer';
    column-gap: 64px; align-items: start;
  }
  .hero { grid-area: hero; }
  .calc { grid-area: calc; margin-top: 0; position: sticky; top: 24px; }
  .about { grid-area: about; margin-top: 32px; }
  .footer { grid-area: footer; margin-top: 48px; }
  .hero__title { font-size: clamp(34px, 3.4vw, 46px); line-height: 1.08; }
  .hero__sub { font-size: 20px; margin-top: 14px; }
  .hero { --fw: clamp(170px, 18vw, 240px); }
  .hero__master { padding: 26px 0 28px 20px; gap: 14px; margin-top: 22px; }
  .bubble--second { width: calc(100% - 44px); }
  .opt { padding-left: 14px; padding-right: 14px; }
  .bubble { font-size: 17px; padding: 20px 22px; border-radius: 22px; }
  .bubble--first { padding-top: 30px; }
  .bubble--first::before { font-size: 56px; left: 18px; }
  .calc__title { font-size: 30px; }
  .quiz { padding: 28px 28px 30px; }
  .step__title { font-size: 23px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
