/* ---------- Шрифты (лежат в public/fonts, работают без Google) ---------- */
@font-face { font-family: 'Onest'; font-weight: 400; font-display: swap; src: url('../fonts/onest-cyrillic-400-normal.woff2') format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Onest'; font-weight: 400; font-display: swap; src: url('../fonts/onest-latin-400-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Onest'; font-weight: 500; font-display: swap; src: url('../fonts/onest-cyrillic-500-normal.woff2') format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Onest'; font-weight: 500; font-display: swap; src: url('../fonts/onest-latin-500-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122, U+2212; }
@font-face { font-family: 'Onest'; font-weight: 600; font-display: swap; src: url('../fonts/onest-cyrillic-600-normal.woff2') format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Onest'; font-weight: 600; font-display: swap; src: url('../fonts/onest-latin-600-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122, U+2212; }
@font-face { font-family: 'Unbounded'; font-weight: 500; font-display: swap; src: url('../fonts/unbounded-cyrillic-500-normal.woff2') format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Unbounded'; font-weight: 500; font-display: swap; src: url('../fonts/unbounded-latin-500-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122, U+2212; }
@font-face { font-family: 'Unbounded'; font-weight: 600; font-display: swap; src: url('../fonts/unbounded-cyrillic-600-normal.woff2') format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Unbounded'; font-weight: 600; font-display: swap; src: url('../fonts/unbounded-latin-600-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122, U+2212; }

/* ---------- Токены ---------- */
:root {
  --porcelain: #EEF1EF;
  --grout: #DCE1DE;
  --surface: #FFFFFF;
  --ink: #17211F;
  --mist: #56625E;
  --line: #CBD2CE;
  --glaze: #1F4E4B;
  --glaze-deep: #153937;
  --glaze-tint: #E3ECEA;
  --brass: #A97A3C;
  --brass-tint: #F3EBDD;
  --error: #A3352A;
  --error-tint: #F8E7E4;

  --font-display: 'Unbounded', 'Arial Black', sans-serif;
  --font-body: 'Onest', 'Segoe UI', Roboto, Arial, sans-serif;

  --radius-panel: 16px;
  --radius-card: 12px;
  --radius-control: 10px;
  --radius-tile: 4px;
  --shadow-float: 0 18px 40px -24px rgba(21, 57, 55, 0.45);

  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 76px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background-color: var(--porcelain);
  /* Стена в плитке 60×30: тонкие швы */
  background-image:
    linear-gradient(var(--grout) 1px, transparent 1px),
    linear-gradient(90deg, var(--grout) 1px, transparent 1px);
  background-size: 120px 60px;
  background-position: -1px -1px;
}

img { max-width: 100%; display: block; }
a { color: var(--glaze); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--brass); outline-offset: 2px; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.skip {
  position: absolute; left: 16px; top: -60px; z-index: 30;
  background: var(--glaze); color: #fff; padding: 10px 14px; border-radius: var(--radius-control);
}
.skip:focus { top: 12px; }

.wrap { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 24px; } }

.section-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(24px, 3.4vw, 34px);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 20px;
}

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 50px; padding: 0 22px;
  border-radius: var(--radius-control); border: 1px solid transparent;
  font: 600 16px/1.2 var(--font-body); text-decoration: none; cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s, transform 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--glaze); color: #fff; }
.btn--primary:hover { background: var(--glaze-deep); }
.btn--primary:disabled { background: #7E9794; cursor: not-allowed; }
.btn--ghost { background: var(--surface); color: var(--glaze); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--glaze); }
.btn--large { min-height: 56px; padding: 0 26px; font-size: 17px; }
.btn--small { min-height: 40px; padding: 0 16px; font-size: 15px; }

.link-button {
  border: 0; background: none; padding: 4px 0; color: var(--glaze);
  font: 500 15px/1.4 var(--font-body); text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}

/* ---------- Шапка ---------- */
.site-head {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-head__inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; min-width: 0; }
.brand__logo {
  flex: none; display: grid; place-items: center; height: 40px; padding: 0 10px;
  border: 1.5px dashed var(--mist); border-radius: 10px; font-size: 12px; color: var(--mist);
}
.brand__name { font-weight: 600; font-size: 15px; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.site-head__actions { display: flex; align-items: center; gap: 16px; }
.phone { font-weight: 600; color: var(--ink); text-decoration: none; white-space: nowrap; }
.phone:hover { color: var(--glaze); }
@media (max-width: 560px) { .phone { display: none; } }

.demo-note { background: var(--brass-tint); border-bottom: 1px solid #E2D3B8; font-size: 14px; padding: 10px 0; color: #5A4424; }

/* ---------- Первый экран ---------- */
.hero { padding: 32px 0 40px; }
.hero__inner { display: grid; gap: 28px; align-items: center; }
@media (min-width: 1000px) {
  .hero { padding: 56px 0 64px; }
  .hero__inner { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 56px; }
}
.hero h1 {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(26px, 7.2vw, 34px); line-height: 1.08; letter-spacing: -0.03em;
  margin: 0 0 18px; max-width: 16ch;
}
@media (min-width: 1000px) { .hero h1 { font-size: clamp(34px, 3.3vw, 46px); } }
.hero__lead { font-size: clamp(17px, 1.6vw, 19px); color: var(--mist); margin: 0 0 26px; max-width: 46ch; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 26px; }
@media (max-width: 560px) { .hero__cta .btn { width: 100%; } }
.hero__facts { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 560px; }
.hero__facts li { font-size: 14px; color: var(--mist); line-height: 1.35; padding-left: 12px; border-left: 2px solid var(--brass); }
.hero__facts strong { display: block; color: var(--ink); font-size: 15px; }

.hero__media { margin: 0; }
.hero__photos { display: grid; grid-template-columns: 1.25fr 1fr; grid-template-rows: 1fr 1fr; gap: 10px; aspect-ratio: 5 / 4.4; }
.ph { position: relative; overflow: hidden; border-radius: var(--radius-card); background: var(--grout); }
.ph img:not(.wm) { width: 100%; height: 100%; object-fit: cover; }
.ph--tall { grid-row: 1 / span 2; }
.hero__media figcaption { margin-top: 10px; font-size: 13px; color: var(--mist); }
@media (max-width: 999px) {
  .hero__photos { aspect-ratio: auto; display: flex; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -16px; padding: 0 16px; gap: 10px; scrollbar-width: none; }
  .hero__photos::-webkit-scrollbar { display: none; }
  .ph { flex: 0 0 72%; aspect-ratio: 4 / 5; scroll-snap-align: start; }
  .hero__media figcaption { margin-top: 8px; }
}

/* Водяной знак-заглушка поверх любой картинки */
.wm { position: absolute; right: 2.5%; bottom: 2.5%; width: 30%; max-width: 260px; min-width: 88px; height: auto; pointer-events: none; user-select: none; }

/* ---------- Как это работает ---------- */
.how { padding: 8px 0 48px; }
.how__steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.how__steps li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card); padding: 20px; }
.how__num {
  display: inline-grid; place-items: center; width: 34px; height: 34px; margin-bottom: 12px;
  border: 1px solid var(--line); border-radius: var(--radius-tile); background: var(--porcelain);
  font-family: var(--font-display); font-weight: 500; font-size: 14px; color: var(--glaze);
}
.how__steps h3 { margin: 0 0 6px; font-size: 18px; }
.how__steps p { margin: 0; color: var(--mist); font-size: 15px; }

/* ---------- Конструктор ---------- */
.generator { padding: 24px 0 56px; scroll-margin-top: 56px; }
.generator__grid { display: grid; gap: 20px; align-items: start; }
@media (min-width: 1000px) { .generator__grid { grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; } }

.wizard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-panel); min-width: 0; scroll-margin-top: 80px; }
.results, .order { scroll-margin-top: 72px; }

.progress { list-style: none; margin: 0; padding: 16px 20px 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.progress button {
  width: 100%; border: 0; background: none; padding: 0 0 4px; text-align: left; cursor: pointer;
  font: 500 13px/1.3 var(--font-body); color: var(--mist);
}
.progress button::before { content: ''; display: block; height: 5px; border-radius: 3px; background: var(--grout); margin-bottom: 8px; transition: background-color 0.2s; }
.progress button[data-state='done']::before { background: #8FB0AC; }
.progress button[data-state='current']::before { background: var(--glaze); }
.progress button[data-state='current'] { color: var(--ink); font-weight: 600; }
.progress button:disabled { cursor: default; }
@media (max-width: 640px) {
  .progress button span { display: none; }
  .progress button[data-state='current'] span { display: inline; white-space: nowrap; }
}

.wizard__body { padding: 20px 20px 8px; }
.wizard__title { font-family: var(--font-display); font-weight: 500; font-size: 20px; letter-spacing: -0.01em; margin: 0 0 18px; }
.wizard__title:focus { outline: none; }
.step:not(.is-current) { display: none; }
.step.is-current { animation: stepIn 0.25s ease-out both; }
@keyframes stepIn { from { opacity: 0; transform: translateX(10px); } to { opacity: 1; transform: none; } }

.wizard__nav {
  position: sticky; bottom: 0; z-index: 5;
  display: flex; justify-content: space-between; gap: 12px;
  padding: 14px 20px calc(14px + env(safe-area-inset-bottom));
  background: var(--surface); border-top: 1px solid var(--grout);
  border-radius: 0 0 var(--radius-panel) var(--radius-panel);
}
.wizard__nav .btn--primary { flex: 1; max-width: 360px; margin-left: auto; }
.captcha { padding: 0 20px 12px; }

/* Группа вариантов */
.group { padding: 4px 0 22px; min-width: 0; }
.group + .group { border-top: 1px solid var(--grout); padding-top: 20px; }
.group__head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.group__title { font-weight: 600; font-size: 16px; }
.optional { font-size: 13px; color: var(--mist); }
.group__hint { margin: 0 0 12px; font-size: 14px; color: var(--mist); }
.group__head + .choices { margin-top: 10px; }

.choices { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.choices--three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 560px) { .choices--three { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.choices:not(.choices--photo) .choice__body { padding-right: 32px; }
.choice { position: relative; display: block; cursor: pointer; min-width: 0; }
.choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.choice__body {
  position: relative; display: flex; flex-direction: column; gap: 2px; height: 100%;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-control); background: var(--surface);
  transition: border-color 0.15s, background-color 0.15s, box-shadow 0.15s;
}
.choice:hover .choice__body { border-color: var(--glaze); }
.choice__label { font-weight: 500; line-height: 1.3; }
.choice__note { font-size: 13px; color: var(--mist); line-height: 1.35; }
.choice input:checked + .choice__body { border-color: var(--glaze); background: var(--glaze-tint); box-shadow: inset 0 0 0 1px var(--glaze); }
.choice input:focus-visible + .choice__body { outline: 3px solid var(--brass); outline-offset: 2px; }
.choice input:disabled + .choice__body { opacity: 0.45; cursor: not-allowed; background: var(--porcelain); }
.choice input:checked + .choice__body::after {
  content: ''; position: absolute; top: 8px; right: 8px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--glaze) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5.5 10.5l3 2.8L14.5 7' fill='none' stroke='%23fff' stroke-width='2'/%3E%3C/svg%3E") center/20px no-repeat;
  box-shadow: 0 0 0 2px #fff;
}

/* «Подберём сами» — всегда первый пункт группы, на всю ширину */
.choice--auto { grid-column: 1 / -1; }
.choices .choice--auto .choice__body {
  flex-direction: row; align-items: center; gap: 12px; padding: 12px 40px 12px 14px;
  background: var(--porcelain); border-style: dashed; border-radius: var(--radius-control);
}
.choice--auto .choice__icon {
  flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
  background: var(--surface); border: 1px solid var(--line); color: var(--brass);
}
.choices .choice--auto .choice__text { display: flex; flex-direction: column; gap: 2px; padding: 0; }
.choices .choice--auto input:checked + .choice__body { border-style: solid; background: var(--glaze-tint); box-shadow: inset 0 0 0 1px var(--glaze); }
.chip--auto span { border-style: dashed; }

/* Стиль — карточки с фото */
.choices--photo { gap: 10px; }
.choices--photo .choice__body { padding: 0; overflow: hidden; border-radius: var(--radius-card); }
.choices--photo .choice__img { display: block; aspect-ratio: 4 / 5; background: var(--grout); overflow: hidden; }
.choices--photo .choice__img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s; }
.choices--photo .choice:hover .choice__img img { transform: scale(1.03); }
.choices--photo .choice__text { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px 12px; }
.choices--photo input:checked + .choice__body { box-shadow: 0 0 0 3px var(--glaze); background: var(--surface); }
.choices--photo input:checked + .choice__body::after { top: 10px; right: 10px; }

/* Цвет — полоски образцов */
.choices--swatch .swatch { height: 40px; }
.swatch { display: block; height: 44px; margin-bottom: 8px; border-radius: 6px; border: 1px solid rgba(23, 33, 31, 0.12); }
.choices--swatch .choice__body { padding: 8px 8px 10px; }

/* Металл — кружки */
.choices--metal { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
.choices--metal .choice__body { flex-direction: row; align-items: center; gap: 10px; padding: 10px 12px; }
.metal { flex: none; width: 28px; height: 28px; border-radius: 50%; border: 1px solid rgba(23, 33, 31, 0.18); }

/* Мультивыбор — компактные «таблетки» */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; cursor: pointer; }
.chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chip span {
  display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 8px 14px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: 15px; line-height: 1.25;
  transition: border-color 0.15s, background-color 0.15s, color 0.15s;
}
.chip:hover span { border-color: var(--glaze); }
.chip input:checked + span { background: var(--glaze); border-color: var(--glaze); color: #fff; }
.chip input[type='checkbox'] + span::before {
  content: ''; width: 16px; height: 16px; border-radius: 4px; border: 1.5px solid var(--line); background: var(--surface); flex: none;
}
.chip input[type='checkbox']:checked + span::before {
  border-color: #fff; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5l2.8 2.5L12.5 5' fill='none' stroke='%231F4E4B' stroke-width='2'/%3E%3C/svg%3E") center/14px no-repeat;
}
.chip input:focus-visible + span { outline: 3px solid var(--brass); outline-offset: 2px; }
.chip input:disabled + span { opacity: 0.45; cursor: not-allowed; }

/* Фото */
.dropzone {
  display: block; position: relative; border: 2px dashed var(--line); border-radius: var(--radius-card);
  background: var(--porcelain); cursor: pointer; transition: border-color 0.15s, background-color 0.15s;
}
.dropzone:hover, .dropzone.is-over { border-color: var(--glaze); background: var(--glaze-tint); }
.dropzone:focus-within { outline: 3px solid var(--brass); outline-offset: 2px; }
.dropzone__empty { display: grid; justify-items: center; gap: 6px; padding: 40px 16px; text-align: center; color: var(--glaze); }
.dropzone__empty strong { font-size: 18px; color: var(--ink); }
.dropzone__empty span { font-size: 14px; color: var(--mist); }
.dropzone__preview { display: grid; gap: 12px; padding: 12px; }
@media (min-width: 640px) { .dropzone__preview { grid-template-columns: 220px 1fr; align-items: center; } }
.dropzone__preview img { width: 100%; max-height: 300px; object-fit: cover; border-radius: var(--radius-control); }
.dropzone__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.ok-badge { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--glaze); }
.ok-badge::before { content: ''; width: 18px; height: 18px; border-radius: 50%; background: var(--glaze) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Cpath d='M5 9.5l2.6 2.4L13 6.5' fill='none' stroke='%23fff' stroke-width='2'/%3E%3C/svg%3E") center/18px no-repeat; }
.tips { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.tips li { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--mist); }
.tips svg { flex: none; color: var(--glaze); margin-top: 1px; }
.no-photo { margin: 18px 0 8px; }

.field-error { margin: 10px 0 0; padding: 10px 12px; border-radius: var(--radius-control); background: var(--error-tint); color: var(--error); font-size: 14px; }

/* Пожелания */
.wishes { position: relative; }
.wishes textarea {
  width: 100%; min-height: 96px; resize: vertical; padding: 12px 14px 28px;
  border: 1px solid var(--line); border-radius: var(--radius-control); font: 400 16px/1.5 var(--font-body); color: var(--ink); background: var(--surface);
}
.wishes textarea:focus { outline: none; border-color: var(--glaze); box-shadow: 0 0 0 3px var(--glaze-tint); }
.wishes textarea[aria-invalid='true'] { border-color: var(--error); }
.wishes__count { position: absolute; right: 12px; bottom: 8px; font-size: 12px; color: var(--mist); font-variant-numeric: tabular-nums; }
.hint-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.hint-chips button {
  border: 1px dashed var(--line); background: var(--porcelain); color: var(--ink); border-radius: 999px;
  padding: 6px 12px; font: 400 14px/1.3 var(--font-body); cursor: pointer;
}
.hint-chips button:hover { border-color: var(--glaze); color: var(--glaze); }

/* Сводка */
.summary { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-panel); padding: 18px; }
@media (min-width: 1000px) { .summary { position: sticky; top: 88px; } }
@media (max-width: 999px) { .summary { display: none; } }
.summary h3 { margin: 0 0 12px; font-size: 16px; }
.summary__photo { position: relative; aspect-ratio: 4 / 3; border-radius: var(--radius-control); overflow: hidden; background: var(--porcelain); display: grid; place-items: center; color: var(--mist); font-size: 14px; margin-bottom: 14px; }
.summary__photo img { width: 100%; height: 100%; object-fit: cover; }
.summary__list { margin: 0; display: grid; gap: 0; }
.summary__row { display: grid; grid-template-columns: 96px 1fr; gap: 8px; padding: 8px 0; border-top: 1px solid var(--grout); font-size: 14px; }
.summary__row dt { color: var(--mist); }
.summary__row dd { margin: 0; }
.summary__row button { all: unset; cursor: pointer; color: var(--ink); }
.summary__row button:hover { color: var(--glaze); text-decoration: underline; }
.summary__row button:focus-visible { outline: 3px solid var(--brass); }
.summary__note { margin: 12px 0 0; font-size: 13px; color: var(--mist); }

/* ---------- Результаты ---------- */
.results { padding: 8px 0 48px; }
.results__head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 18px; }
.results__head .section-title { margin-bottom: 6px; }
.results__sub { margin: 0; color: var(--mist); }

/* Все генерации сделаны: вместо конструктора — подсказка перейти к вариантам */
.limit-done {
  max-width: 760px; padding: 28px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-panel);
  scroll-margin-top: 80px;
}
.limit-done .section-title { margin-bottom: 10px; }
.limit-done p { margin: 0 0 20px; color: var(--mist); max-width: 60ch; }
.limit-done__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
@media (max-width: 560px) { .limit-done { padding: 20px; } .limit-done__actions .btn { width: 100%; } }

.loader {
  display: flex; align-items: center; gap: 22px; margin-bottom: 20px; padding: 18px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-panel);
}
.loader__wall { flex: none; display: grid; grid-template-columns: repeat(8, 1fr); gap: 3px; width: min(46vw, 260px); aspect-ratio: 8 / 5; padding: 3px; background: #CBD2CE; border-radius: var(--radius-tile); }
.tile { border-radius: 2px; background: var(--porcelain); }
.tile.is-laid { background: var(--tile-color, #fff); animation: lay 0.42s cubic-bezier(0.2, 0.8, 0.3, 1.2) both; }
@keyframes lay {
  0% { opacity: 0; transform: translateY(-14px) scale(1.12); box-shadow: 0 10px 14px rgba(23, 33, 31, 0.18); }
  70% { opacity: 1; transform: translateY(1px) scale(1); box-shadow: 0 1px 1px rgba(23, 33, 31, 0.1); }
  100% { transform: none; box-shadow: none; }
}
.loader__status { margin: 0 0 6px; font-family: var(--font-display); font-weight: 500; font-size: clamp(16px, 2vw, 20px); letter-spacing: -0.01em; }
.loader__meta { display: flex; gap: 16px; margin: 0; color: var(--mist); font-size: 14px; font-variant-numeric: tabular-nums; }
@media (max-width: 560px) { .loader { flex-direction: column; align-items: stretch; text-align: center; } .loader__wall { width: 100%; } .loader__meta { justify-content: center; } }

.result-error { margin: 0 0 20px; padding: 14px 16px; border-radius: var(--radius-control); background: var(--error-tint); color: var(--error); }

/* Генерации: новые сверху, у каждой — заголовок с фото клиента и главными параметрами */
.gens { margin-bottom: 16px; }
.gen + .gen { margin-top: 12px; padding-top: 24px; border-top: 1px solid var(--line); }
.gen__head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.gen__source img { display: block; width: 56px; height: 42px; object-fit: cover; border-radius: 6px; }
.gen__title { margin: 0; font-family: var(--font-display); font-weight: 500; font-size: 17px; letter-spacing: -0.01em; }
.gen__meta { margin: 2px 0 0; font-size: 14px; color: var(--mist); }

/* Галерея как на Pinterest: колонки разной высоты, варианты раскладываются по порядку слева направо */
.gallery { display: grid; grid-template-columns: repeat(var(--cols, 1), minmax(0, 1fr)); gap: 16px; align-items: start; margin-bottom: 16px; }
.gallery__col { display: grid; gap: 16px; min-width: 0; }
.shot { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card); overflow: hidden; }
.shot__frame { position: relative; display: block; width: 100%; padding: 0; border: 0; background: var(--grout); cursor: zoom-in; }
.shot__frame img:not(.wm) { width: 100%; height: auto; }
.shot__frame.is-pending, .shot__frame.is-failed {
  cursor: default; display: grid; place-items: center; aspect-ratio: 4 / 5; color: var(--mist); font: 500 15px var(--font-body);
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 40px 20px;
}
.shot__frame.is-pending span { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.45; } }
.shot__frame.is-new img:not(.wm) { animation: reveal 0.6s ease-out both; }
@keyframes reveal { from { opacity: 0; } to { opacity: 1; } }
.shot.is-picked { border-color: var(--glaze); box-shadow: 0 0 0 3px var(--glaze); }
.shot figcaption { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; }
.shot__label { font-weight: 500; font-size: 15px; min-width: 0; }
.shot__label small { display: block; color: var(--mist); font-weight: 400; font-size: 13px; }
.pick {
  flex: none; display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line); background: var(--surface); color: var(--glaze);
  border-radius: 999px; padding: 8px 14px; font: 600 14px/1.2 var(--font-body); cursor: pointer;
}
.pick:hover { border-color: var(--glaze); }
.pick[aria-pressed='true'] { background: var(--glaze); border-color: var(--glaze); color: #fff; }

.results__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-top: 8px; }
.disclaimer {
  margin: 0; padding: 12px 14px; border-left: 3px solid var(--brass); background: var(--brass-tint);
  font-size: 14px; color: #4D3B20; border-radius: 0 var(--radius-tile) var(--radius-tile) 0; flex: 1 1 360px;
}

/* ---------- Заказ замера ---------- */
.order { padding: 0 0 56px; }
.order__card {
  display: grid; gap: 24px; padding: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-panel);
}
@media (min-width: 900px) { .order__card { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 40px; padding: 32px; } }
.order__intro p { margin: 0 0 16px; color: var(--mist); max-width: 46ch; }
.order__chosen { padding: 14px; border-radius: var(--radius-card); background: var(--porcelain); font-size: 14px; color: var(--mist); }
.order__chosen p { margin: 0; }
.order__chosen-empty { color: var(--ink); }
.order__chosen-title { font-weight: 600; color: var(--ink); margin-bottom: 10px !important; }
.chosen-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.chosen-item { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.chosen-item .thumb { position: relative; display: block; }
.chosen-item .thumb img:not(.wm) { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.chosen-item .thumb .wm { width: 44%; min-width: 0; }
.chosen-item__label { display: block; padding: 8px 10px 10px; font-weight: 500; color: var(--ink); font-size: 14px; line-height: 1.3; }
.chosen-item__label small { display: block; font-weight: 400; color: var(--mist); font-size: 12px; }
.chosen-item__remove {
  position: absolute; top: 6px; right: 6px; width: 30px; height: 30px; display: grid; place-items: center;
  border: 0; border-radius: 50%; background: rgba(255, 255, 255, 0.94); color: var(--ink); cursor: pointer;
}
.chosen-item__remove:hover { color: var(--error); }
.order__hint { margin: -4px 0 0; font-size: 14px; color: var(--mist); text-align: center; }
.results__actions { display: flex; flex-wrap: wrap; gap: 10px; }
@media (max-width: 560px) { .results__actions { width: 100%; } .results__actions .btn { flex: 1; } }
.order__fields { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); align-content: start; }
.field--wide { grid-column: 1 / -1; }
@media (max-width: 560px) { .order__fields { grid-template-columns: 1fr; } }
.field { display: grid; gap: 6px; font-size: 14px; font-weight: 500; border: 0; margin: 0; padding: 0; min-width: 0; }
.field legend { padding: 0; margin-bottom: 8px; }
.field em { font-style: normal; font-weight: 400; color: var(--mist); }
.field input[type='text'], .field input[type='tel'] {
  min-height: 50px; padding: 0 14px; border: 1px solid var(--line); border-radius: var(--radius-control);
  font: 400 16px var(--font-body); color: var(--ink); background: var(--surface);
}
.field input:focus { border-color: var(--glaze); outline: none; box-shadow: 0 0 0 3px var(--glaze-tint); }
.field input[aria-invalid='true'] { border-color: var(--error); }
.consent { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--mist); cursor: pointer; }
.consent input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--glaze); flex: none; }
.order__fields .field-error { margin: 0; }
.order__done { margin: 0; padding: 16px; border-radius: var(--radius-control); background: var(--glaze-tint); color: var(--glaze-deep); font-weight: 500; }

/* ---------- Вопросы ---------- */
.faq { padding: 0 0 56px; }
.faq__list { display: grid; gap: 8px; max-width: 860px; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card); padding: 0 18px; }
.faq summary { cursor: pointer; list-style: none; padding: 16px 28px 16px 0; font-weight: 600; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ''; position: absolute; right: 2px; top: 50%; width: 10px; height: 10px; border-right: 2px solid var(--glaze); border-bottom: 2px solid var(--glaze); transform: translateY(-70%) rotate(45deg); transition: transform 0.2s; }
.faq details[open] summary::after { transform: translateY(-30%) rotate(-135deg); }
.faq details p { margin: 0 0 16px; color: var(--mist); max-width: 70ch; }

/* ---------- Подвал ---------- */
.site-foot { background: var(--surface); border-top: 1px solid var(--line); padding: 22px 0 calc(28px + env(safe-area-inset-bottom)); font-size: 14px; color: var(--mist); }
.site-foot__inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; }
.site-foot p { margin: 0; max-width: 70ch; }
.site-foot a + a { margin-left: 16px; }

/* ---------- Просмотр ---------- */
.viewer {
  width: min(1100px, calc(100vw - 24px)); max-height: calc(100dvh - 24px);
  padding: 14px; border: 0; border-radius: var(--radius-panel); background: var(--surface); color: var(--ink);
}
.viewer::backdrop { background: rgba(15, 24, 22, 0.82); }
.viewer figure { margin: 0; }
.viewer__img { position: relative; display: flex; justify-content: center; background: var(--porcelain); border-radius: var(--radius-control); overflow: hidden; }
.viewer__img img:not(.wm) { max-width: 100%; max-height: calc(100dvh - 190px); width: auto; object-fit: contain; }
.viewer__img .wm { width: 22%; }
.viewer figcaption { padding: 10px 48px 0 2px; color: var(--mist); font-size: 15px; }
.viewer__bar { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; margin-top: 12px; }
.viewer__close {
  position: absolute; top: 22px; right: 22px; width: 42px; height: 42px; display: grid; place-items: center;
  border: 0; border-radius: 50%; background: rgba(255, 255, 255, 0.94); color: var(--ink); cursor: pointer;
}
@media (max-width: 640px) {
  .viewer { padding: 10px; }
  .viewer__bar { grid-template-columns: 1fr 1fr; }
  .viewer__bar #viewerPick { grid-column: 1 / -1; grid-row: 1; }
  .viewer__close { top: 16px; right: 16px; }
}

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