/* Pet Tales. Цвета взяты из иллюстраций образца: кремовый фон, синий, коралловый, песочный. */
:root {
  color-scheme: light;
  --bg: #fbf6ec;
  --card: #fffdf8;
  --tint: #f3e6cb;
  --ink: #2b2620;
  --muted: #6b6156;
  --line: #e4d6bb;
  --blue: #2350a8;
  --blue-dark: #193d84;
  --coral: #d9603f;
  --green: #2f6b4f;
  --error: #b3261e;
  --radius: 18px;
  --shadow: 0 18px 40px -18px rgba(60, 40, 10, .35);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.6 var(--sans);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue); }
h1, h2, h3 { font-family: var(--serif); line-height: 1.15; margin: 0 0 .5em; font-weight: 700; }
h1 { font-size: clamp(2.1rem, 5vw, 3.3rem); letter-spacing: -.01em; }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.3rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 720px; }
.muted { color: var(--muted); }

/* Шапка и подвал */
.site-header { padding: 14px 0; border-bottom: 1px solid var(--line); background: var(--bg); }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.logo { display: flex; align-items: center; gap: 10px; font: 700 1.3rem var(--serif); color: var(--ink); text-decoration: none; }
.nav { display: flex; align-items: center; gap: 22px; }
.nav a:not(.btn) { color: var(--ink); text-decoration: none; font-size: .95rem; }
.nav a:not(.btn):hover { color: var(--blue); }
.site-footer { border-top: 1px solid var(--line); padding: 28px 0 36px; color: var(--muted); font-size: .9rem; }
.footer-row { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.site-footer a { color: var(--muted); }

/* Кнопки */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 12px 26px; border-radius: 999px;
  border: 2px solid var(--blue); background: transparent; color: var(--blue);
  font: 600 1rem var(--sans); text-decoration: none; cursor: pointer;
  transition: background .15s, color .15s, transform .15s;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-dark); border-color: var(--blue-dark); }
.btn-secondary { background: var(--card); }
.btn-small { min-height: 38px; padding: 6px 18px; font-size: .9rem; }
.btn-wide { width: 100%; }
.btn:disabled { opacity: .6; cursor: progress; transform: none; }
.btn:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 3px solid var(--coral); outline-offset: 2px;
}

/* Первый экран */
.hero { padding: 56px 0 64px; overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 48px; align-items: center; }
.eyebrow { color: var(--coral); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; font-size: .85rem; margin-bottom: .8em; }
.lead { font-size: 1.15rem; color: #463e35; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0 14px; }
.hero-note { color: var(--muted); font-size: .95rem; }
.hero-book { margin: 0; justify-self: center; max-width: 380px; }
.hero-book img { border-radius: 6px 14px 14px 6px; box-shadow: var(--shadow), -6px 0 0 #e9dcc2; transform: rotate(2deg); }
.hero-book figcaption { margin-top: 16px; text-align: center; color: var(--muted); font-size: .85rem; }

/* Секции */
.section { padding: 64px 0; }
.section-tint { background: var(--tint); }
.section-lead { max-width: 720px; color: #463e35; margin-bottom: 32px; }

.spreads { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.spread { margin: 0; background: var(--card); border-radius: var(--radius); padding: 12px 12px 16px; box-shadow: 0 10px 24px -16px rgba(60, 40, 10, .4); }
.spread img { border-radius: 10px; }
.spread figcaption { font-family: var(--serif); font-size: 1rem; line-height: 1.45; margin-top: 12px; color: #3a332b; }

/* Фото питомца -> страницы книжки */
.likeness { display: grid; grid-template-columns: minmax(180px, 1fr) auto minmax(0, 3fr); gap: 24px; align-items: center; }
.likeness-photo { margin: 0; background: #fff; padding: 10px 10px 14px; border-radius: 6px; box-shadow: var(--shadow); transform: rotate(-2deg); }
.likeness-photo img { border-radius: 2px; }
.likeness-photo figcaption { margin-top: 10px; font-size: .9rem; color: var(--muted); text-align: center; }
.likeness-photo figcaption strong { display: block; color: var(--ink); font-family: var(--serif); font-size: 1.05rem; }
.likeness-arrow { width: 48px; height: 24px; color: var(--coral); }
.likeness-pages { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; counter-reset: step; }
.steps li { background: var(--card); border-radius: var(--radius); padding: 24px 22px; counter-increment: step; }
.steps li::before {
  content: counter(step); display: grid; place-items: center;
  width: 40px; height: 40px; border-radius: 50%; margin-bottom: 14px;
  background: var(--coral); color: #fff; font: 700 1.1rem var(--serif);
}
.steps h3 { font-size: 1.12rem; }
.steps p { margin: 0; color: #463e35; font-size: .98rem; }

.themes { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.themes li { background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 8px 18px; font-family: var(--serif); }

/* Предложения */
.offers { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
.offers-single { grid-template-columns: minmax(0, 560px); justify-content: center; }
.offer { background: var(--card); border-radius: var(--radius); padding: 30px 28px; box-shadow: var(--shadow); border-top: 6px solid var(--green); scroll-margin-top: 20px; }
.offer-paid { border-top-color: var(--blue); }
.offer-tag { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: .4em; }
.offer-price { font: 700 2.2rem var(--serif); margin-bottom: .4em; }
.offer-price span { font-size: 1rem; color: var(--muted); font-family: var(--sans); font-weight: 500; }
.ticks { list-style: none; padding: 0; margin: 0 0 24px; }
.ticks li { position: relative; padding-left: 28px; margin-bottom: 8px; }
.ticks li::before { content: ""; position: absolute; left: 4px; top: .45em; width: 12px; height: 7px; border-left: 2.5px solid var(--green); border-bottom: 2.5px solid var(--green); transform: rotate(-45deg); }

/* Форма заявки */
.lead-form { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; border: 0; padding: 0; margin: 0; min-width: 0; }
.field > label, .field > legend { font-weight: 600; font-size: .95rem; padding: 0; }
.optional { font-weight: 400; color: var(--muted); }
input[type=email], select {
  width: 100%; min-height: 48px; padding: 10px 14px; font: inherit; color: var(--ink);
  background: #fff; border: 1.5px solid var(--line); border-radius: 12px;
}
input[type=email]:focus, select:focus { border-color: var(--blue); outline: none; box-shadow: 0 0 0 3px rgba(35, 80, 168, .18); }
.has-error input, .has-error select { border-color: var(--error); }
.error { color: var(--error); font-size: .9rem; margin: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.chip { display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 6px 16px; border: 1.5px solid var(--line); border-radius: 999px; background: #fff; cursor: pointer; font-weight: 400; }
.chip:has(input:checked) { border-color: var(--blue); background: #eef2fb; }
.chip input { accent-color: var(--blue); margin: 0; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .95rem; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 3px 0 0; accent-color: var(--blue); flex: none; }
.fineprint { font-size: .85rem; color: var(--muted); margin: 0; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* Окно заявки */
.lead-dialog {
  width: min(520px, calc(100vw - 24px)); max-height: calc(100vh - 24px); overflow: auto;
  border: 0; border-radius: var(--radius); padding: 30px 26px 26px; background: var(--card); color: var(--ink);
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .45);
}
.lead-dialog::backdrop { background: rgba(43, 38, 32, .55); }
.dialog-close { position: absolute; top: 10px; right: 12px; width: 40px; height: 40px; border: 0; background: transparent; font-size: 1.8rem; line-height: 1; color: var(--muted); cursor: pointer; border-radius: 50%; }
.dialog-close:hover { background: var(--tint); }

/* Вопросы */
details { border-bottom: 1px solid var(--line); padding: 4px 0; }
summary { cursor: pointer; list-style: none; padding: 14px 32px 14px 0; font-weight: 600; position: relative; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; position: absolute; right: 4px; top: 10px; font-size: 1.5rem; color: var(--coral); }
details[open] summary::after { content: "\2212"; }
details p { color: #463e35; }

/* Спасибо, политика */
.thanks h1 { font-size: clamp(1.9rem, 4.5vw, 2.6rem); }
.next-step { background: var(--card); border-radius: var(--radius); padding: 26px; margin: 28px 0; box-shadow: var(--shadow); border-top: 6px solid var(--coral); }
.next-step h2 { font-size: 1.4rem; }
.prose h2 { font-size: 1.35rem; margin-top: 1.6em; }
.prose ul { padding-left: 1.2em; }
.prose li { margin-bottom: .5em; }

/* Анкета */
.q-head { margin-bottom: 28px; }
.q-head h1 { font-size: clamp(1.9rem, 4.5vw, 2.6rem); }
.req { color: var(--coral); font-weight: 700; }
.q-alert { background: #fdecea; color: var(--error); border-radius: 12px; padding: 14px 18px; margin-bottom: 20px; font-weight: 600; }
.q-progress { color: var(--muted); font-weight: 600; margin-bottom: 12px; }
.q-step { border: 0; padding: 28px 26px; margin: 0 0 24px; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.q-step > legend { float: left; width: 100%; padding: 0; margin-bottom: 8px; }
.q-step > legend h2 { font-size: 1.6rem; margin: 0; }
.q-step > legend + * { clear: both; }
.q-step-help { color: var(--muted); margin: 0 0 8px; }
.q-field { padding: 18px 0; border-bottom: 1px solid var(--line); }
.q-field:last-of-type { border-bottom: 0; }
.q-field fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.q-title { display: block; font-weight: 600; font-size: 1.02rem; margin: 0 0 4px; padding: 0; }
.q-help { color: var(--muted); font-size: .92rem; margin: 0 0 10px; }
.q-field textarea, .q-field input[type=text], .q-field input[type=number], .q-field input[type=email] {
  width: 100%; min-height: 48px; padding: 10px 14px; font: inherit; color: var(--ink);
  background: #fff; border: 1.5px solid var(--line); border-radius: 12px;
}
.q-field textarea { min-height: 96px; resize: vertical; }
.q-field .q-short { max-width: 140px; }
.q-field textarea:focus, .q-field input:focus { border-color: var(--blue); outline: none; box-shadow: 0 0 0 3px rgba(35, 80, 168, .18); }
.q-field.has-error textarea, .q-field.has-error input[type=text], .q-field.has-error input[type=number], .q-field.has-error input[type=email] { border-color: var(--error); }
.q-options { display: grid; gap: 8px; margin-top: 6px; }
.q-option { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: #fff; border: 1.5px solid var(--line); border-radius: 12px; cursor: pointer; }
.q-option:has(input:checked) { border-color: var(--blue); background: #eef2fb; }
.q-option:has(input:disabled) { opacity: .55; cursor: default; }
.q-option input[type=radio], .q-option input[type=checkbox] { width: 20px; height: 20px; margin: 0; accent-color: var(--blue); flex: none; }
.q-options-compact { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.q-options-compact .q-other { grid-column: 1 / -1; }
.q-other { flex-wrap: wrap; }
.q-other input[type=text] { flex: 1 1 200px; min-height: 40px; padding: 6px 10px; }
.q-field.has-error .q-option { border-color: #f0c2bd; }
.q-photos { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.q-thumb, .q-add { position: relative; width: 104px; height: 104px; margin: 0; border-radius: 12px; overflow: hidden; }
.q-thumb img { width: 100%; height: 100%; object-fit: cover; }
.q-thumb.is-uploading img { opacity: .45; }
.q-thumb.is-uploading::after { content: ""; position: absolute; inset: 0; margin: auto; width: 28px; height: 28px; border: 3px solid var(--blue); border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.q-thumb-remove { position: absolute; top: 4px; right: 4px; width: 30px; height: 30px; border: 0; border-radius: 50%; background: rgba(43, 38, 32, .7); color: #fff; font-size: 1.2rem; line-height: 1; cursor: pointer; }
.q-add { display: grid; place-content: center; justify-items: center; gap: 2px; border: 2px dashed var(--line); background: #fff; color: var(--blue); font-weight: 600; cursor: pointer; text-align: center; font-size: .9rem; }
.q-add span[aria-hidden] { font-size: 1.8rem; line-height: 1; }
.q-add:hover { border-color: var(--blue); }
.q-add:focus-within { outline: 3px solid var(--coral); outline-offset: 2px; }
.q-add input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.q-add[hidden] { display: none; }
.q-count { font-size: .85rem; margin: 8px 0 0; }
.q-nav { display: flex; justify-content: space-between; gap: 12px; padding-top: 20px; }
.q-nav [data-next], .q-nav [type=submit] { margin-left: auto; }
.q-nav [data-prev], .q-nav [data-next] { display: none; }
.js .q-nav [data-prev], .js .q-nav [data-next] { display: inline-flex; }

@media (max-width: 900px) {
  .spreads, .steps { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  body { font-size: 16px; }
  .likeness { grid-template-columns: 1fr; justify-items: center; gap: 18px; }
  .likeness-photo { max-width: 240px; }
  .likeness-arrow { transform: rotate(90deg); }
  .likeness-pages { width: 100%; }
  .nav a:not(.btn) { display: none; }
  .hero { padding: 32px 0 44px; }
  .hero-grid { grid-template-columns: 1fr; gap: 32px; }
  .hero-book { max-width: 280px; }
  .hero-actions .btn { flex: 1 1 100%; }
  .section { padding: 48px 0; }
  .offers { grid-template-columns: 1fr; }
  .offer { padding: 26px 20px; }
}
@media (max-width: 520px) {
  .q-step { padding: 22px 16px; }
  .q-thumb, .q-add { width: calc(33.33% - 7px); height: auto; aspect-ratio: 1; }
  .likeness-pages { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 62%; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px; }
  .likeness-pages .spread { scroll-snap-align: start; }
  .spreads { grid-template-columns: 1fr 1fr; gap: 12px; }
  .spread { padding: 8px 8px 12px; }
  .spread figcaption { font-size: .9rem; }
  .steps { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn { transition: none; }
}
