/* ==========================================================================
   Бокс 09 · дизайн-система
   Графитовая база, мягкие поверхности с верхним бликом, один акцент из конфига.
   Шрифт: Rubik 500–800. Цифры: тот же Rubik с tabular-nums.
   ========================================================================== */

:root,
[data-theme="dark"] {
  /* База (тёмная тема) */
  --bg: #0A0A0C;
  --surface: #141418;
  --surface-2: #1B1B22;
  --surface-3: #22222B;
  --header-bg: #0A0A0C;
  --totals-bg: #0A0A0C;
  --mobile-bar-bg: #1B1B22;
  --toast-bg: #1B1B22;
  --overlay-bg: rgba(10, 10, 12, 0.92);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --border-hover: rgba(255, 255, 255, 0.24);
  --highlight: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  --shadow-card: 0 24px 48px -32px rgba(0, 0, 0, 0.9);
  --shadow-modal: 0 32px 64px -24px rgba(0, 0, 0, 0.9);
  --shadow-bar: 0 -16px 32px -16px rgba(0, 0, 0, 0.8);
  --shadow-toast: 0 16px 32px -16px rgba(0, 0, 0, 0.9);
  --text: #F4F4F5;
  --text-soft: #D4D4D8;
  --text-muted: #9CA3AF;

  /* 4 семантических акцента (JS пересчитывает по WCAG под тему и HEX) */
  --accent-fill: #F59E0B;
  --accent-fill-rgb: 245 158 11;
  --accent-ink: #0A0A0C;
  --accent-text: #F59E0B;
  --accent-text-rgb: 245 158 11;

  /* Производные акцента: fallback через rgb(), ниже color-mix */
  --accent-soft: rgb(var(--accent-text-rgb) / 0.12);
  --accent-faint: rgb(var(--accent-text-rgb) / 0.06);
  --accent-line: rgb(var(--accent-text-rgb) / 0.58);
  --accent-ring: rgb(var(--accent-fill-rgb) / 0.22);
  --accent-tint: #1E1C1C;

  /* Обратная связь */
  --danger: #EF4444;
  --danger-text: #FCA5A5;
  --danger-soft: rgba(239, 68, 68, 0.12);
  --danger-line: rgba(239, 68, 68, 0.45);

  /* Отступы */
  --sp-25: 2px;
  --sp-50: 4px;
  --sp-75: 8px;
  --sp-100: 12px;
  --sp-200: 16px;
  --sp-300: 24px;
  --sp-400: 32px;
  --sp-500: 40px;
  --sp-600: 48px;
  --sp-700: 64px;
  --sp-800: 80px;
  --sp-900: 96px;

  /* Скругления */
  --r-card: 24px;
  --r-card-inner: 20px;
  --r-control: 14px;
  --r-control-lg: 16px;
  --r-check: 8px;
  --r-pill: 999px;

  /* Типографика */
  --font: "Rubik", ui-rounded, system-ui, -apple-system, "Segoe UI", sans-serif;

  /* Движение */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --dur-fast: 300ms;
  --dur-base: 500ms;

  --container-max: 1200px;
  --header-h: 68px;
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #F6F7F9;
  --surface: #FFFFFF;
  --surface-2: #EEF0F5;
  --surface-3: #E3E7EF;
  --header-bg: #FFFFFF;
  --totals-bg: #EEF0F5;
  --mobile-bar-bg: #FFFFFF;
  --toast-bg: #FFFFFF;
  --overlay-bg: rgba(15, 17, 21, 0.58);
  --border: rgba(15, 17, 21, 0.10);
  --border-strong: rgba(15, 17, 21, 0.18);
  --border-hover: rgba(15, 17, 21, 0.30);
  --highlight: 0 2px 10px -4px rgba(15, 17, 21, 0.06);
  --shadow-card: 0 18px 36px -24px rgba(15, 17, 21, 0.16);
  --shadow-modal: 0 28px 64px -20px rgba(15, 17, 21, 0.24);
  --shadow-bar: 0 -10px 28px -12px rgba(15, 17, 21, 0.16);
  --shadow-toast: 0 14px 30px -12px rgba(15, 17, 21, 0.2);
  --text: #111318;
  --text-soft: #374151;
  --text-muted: #5B6472;
  --accent-tint: #F4F5F8;
  --danger: #DC2626;
  --danger-text: #B91C1C;
  --danger-soft: rgba(220, 38, 38, 0.09);
  --danger-line: rgba(220, 38, 38, 0.36);
}

@supports (color: color-mix(in srgb, red 50%, transparent)) {
  :root,
  [data-theme="dark"] {
    --accent-soft: color-mix(in srgb, var(--accent-text) 12%, transparent);
    --accent-faint: color-mix(in srgb, var(--accent-text) 6%, transparent);
    --accent-line: color-mix(in srgb, var(--accent-text) 58%, transparent);
    --accent-ring: color-mix(in srgb, var(--accent-fill) 22%, transparent);
    --accent-tint: color-mix(in srgb, var(--accent-fill) 7%, #1B1B22);
  }
  [data-theme="light"] {
    --accent-soft: color-mix(in srgb, var(--accent-text) 11%, transparent);
    --accent-faint: color-mix(in srgb, var(--accent-text) 6%, transparent);
    --accent-line: color-mix(in srgb, var(--accent-text) 56%, transparent);
    --accent-ring: color-mix(in srgb, var(--accent-text) 18%, transparent);
    --accent-tint: color-mix(in srgb, var(--accent-text) 5%, #FFFFFF);
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background-color: var(--bg);
  color: var(--text);
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 24px;
  font-weight: 500;
  background-color: var(--bg);
  color: var(--text);
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.modal-open {
  overflow: hidden;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

fieldset {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

legend {
  padding: 0;
}

h1,
h2,
h3,
p {
  margin: 0;
}

/* ==========================================================================
   Типографика
   ========================================================================== */

.heading-1 {
  font-size: 32px;
  line-height: 36px;
  font-weight: 800;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

@media (min-width: 768px) {
  .heading-1 {
    font-size: 48px;
    line-height: 52px;
  }
}

@media (min-width: 1024px) {
  .heading-1 {
    font-size: 56px;
    line-height: 60px;
  }
}

.heading-3 {
  font-size: 30px;
  line-height: 36px;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

@media (min-width: 768px) {
  .heading-3 {
    font-size: 36px;
    line-height: 40px;
  }
}

.heading-6 {
  font-size: 20px;
  line-height: 28px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.title-2 {
  font-size: 18px;
  line-height: 28px;
  font-weight: 700;
}

.title-3 {
  font-size: 16px;
  line-height: 24px;
  font-weight: 600;
}

.body-3 {
  font-size: 16px;
  line-height: 24px;
  font-weight: 500;
  text-wrap: pretty;
}

.body-6 {
  font-size: 14px;
  line-height: 20px;
  font-weight: 500;
  text-wrap: pretty;
}

.num {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

/* ==========================================================================
   Доступность
   ========================================================================== */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: -100px;
  left: var(--sp-200);
  z-index: 200;
  padding: var(--sp-100) var(--sp-300);
  background: var(--accent-fill);
  color: var(--accent-ink);
  border-radius: var(--r-pill);
  font-size: 14px;
  line-height: 20px;
  font-weight: 700;
}

.skip-link:focus {
  top: var(--sp-200);
}

:focus-visible {
  outline: 2px solid var(--accent-text);
  outline-offset: 3px;
}

/* ==========================================================================
   Контейнер, кнопки, иконки
   ========================================================================== */

.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--sp-200);
}

@media (min-width: 768px) {
  .container {
    padding-inline: var(--sp-400);
  }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-75);
  min-height: 48px;
  padding: var(--sp-100) var(--sp-300);
  border-radius: var(--r-control);
  border: 1px solid transparent;
  font-size: 16px;
  line-height: 24px;
  font-weight: 700;
  white-space: nowrap;
  transition:
    background-color var(--dur-fast) var(--ease),
    border-color var(--dur-fast) var(--ease),
    color var(--dur-fast) var(--ease),
    box-shadow var(--dur-fast) var(--ease),
    transform var(--dur-fast) var(--ease);
}

.btn:active {
  transform: scale(0.98);
}

.btn-lg {
  min-height: 56px;
  padding: var(--sp-200) var(--sp-400);
  border-radius: var(--r-control-lg);
  font-size: 18px;
  line-height: 24px;
  font-weight: 800;
}

.btn-sm {
  min-height: 44px;
  padding: var(--sp-75) var(--sp-200);
  font-size: 14px;
  line-height: 20px;
}

.btn-block {
  width: 100%;
}

.btn-primary {
  background-color: var(--accent-fill);
  color: var(--accent-ink);
  border-color: var(--accent-fill);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24), 0 10px 24px -14px var(--accent-line);
}

.btn-primary:hover {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24), 0 0 0 4px var(--accent-ring);
}

.btn-primary:disabled {
  opacity: 0.65;
  cursor: wait;
}

.btn-secondary {
  background-color: var(--surface-2);
  color: var(--text);
  border-color: var(--border-strong);
  box-shadow: var(--highlight);
}

.btn-secondary:hover {
  background-color: var(--surface-3);
  border-color: var(--border-hover);
}

.btn-danger {
  background-color: transparent;
  color: var(--danger-text);
  border-color: var(--danger-line);
}

.btn-danger:hover {
  background-color: var(--danger-soft);
  border-color: var(--danger);
}

.btn.is-done {
  border-color: var(--accent-line);
  color: var(--accent-text);
  background-color: var(--accent-faint);
}

.icon {
  flex-shrink: 0;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: var(--r-control);
  border: 1px solid var(--border-strong);
  background-color: var(--surface-2);
  box-shadow: var(--highlight);
  color: var(--text);
  transition:
    background-color var(--dur-fast) var(--ease),
    transform var(--dur-fast) var(--ease);
}

.icon-btn:hover {
  background-color: var(--surface-3);
}

.icon-btn:active {
  transform: scale(0.95);
}

/* ==========================================================================
   Секция 1: шапка и Hero
   ========================================================================== */

.site-header {
  position: relative;
  z-index: 20;
  height: var(--header-h);
  background-color: var(--header-bg);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-75);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-100);
  min-height: 44px;
  min-width: 0;
}

.brand-mark {
  width: 10px;
  height: 28px;
  border-radius: var(--r-pill);
  background-color: var(--accent-fill);
  box-shadow: 0 0 0 4px var(--accent-soft);
  flex-shrink: 0;
}

.brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.brand-name {
  font-size: 16px;
  line-height: 20px;
  font-weight: 800;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-city {
  font-size: 12px;
  line-height: 16px;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (min-width: 640px) {
  .brand-text {
    flex-direction: row;
    align-items: baseline;
    gap: var(--sp-100);
  }
  .brand-name {
    font-size: 18px;
    line-height: 24px;
  }
  .brand-city {
    font-size: 14px;
    line-height: 20px;
  }
}

.header-contacts {
  display: flex;
  align-items: center;
  gap: var(--sp-75);
  flex-shrink: 0;
}

@media (min-width: 640px) {
  .header-contacts {
    gap: var(--sp-200);
  }
}

.contact-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding-inline: var(--sp-25);
  font-size: 13px;
  line-height: 20px;
  font-weight: 600;
  white-space: nowrap;
  transition: color var(--dur-fast) var(--ease);
}

@media (min-width: 440px) {
  .contact-link {
    font-size: 14px;
    padding-inline: var(--sp-50);
  }
}

@media (min-width: 640px) {
  .contact-link {
    font-size: 16px;
    line-height: 24px;
  }
}

.contact-link:hover {
  color: var(--accent-text);
}

.contact-tg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-75);
  min-width: 44px;
  min-height: 44px;
  padding: var(--sp-75) var(--sp-100);
  border-radius: var(--r-control);
  border: 1px solid var(--border-strong);
  background-color: var(--surface-2);
  box-shadow: var(--highlight);
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
  transition:
    background-color var(--dur-fast) var(--ease),
    border-color var(--dur-fast) var(--ease);
}

.contact-tg:hover {
  background-color: var(--surface-3);
  border-color: var(--border-hover);
}

.contact-tg-label {
  display: none;
}

@media (min-width: 560px) {
  .contact-tg {
    padding-inline: var(--sp-200);
  }
  .contact-tg-label {
    display: inline;
  }
}

.theme-toggle {
  flex-shrink: 0;
}

[data-theme="dark"] .theme-icon-moon {
  display: none;
}

[data-theme="light"] .theme-icon-sun {
  display: none;
}

/* Hero — всегда тёмная студийная сцена для читаемости и контраста авто */

.hero {
  position: relative;
  min-height: 540px;
  display: flex;
  align-items: flex-end;
  padding-block: var(--sp-600);
  overflow: hidden;
  background-color: #0A0A0C;
  color: #F4F4F5;
}

[data-theme="light"] .hero {
  border-bottom: 1px solid var(--border);
}

@media (min-width: 768px) {
  .hero {
    min-height: 600px;
    max-height: 780px;
    height: calc(100svh - var(--header-h));
    align-items: center;
    padding-block: var(--sp-700);
  }
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 72% 40%;
}

@media (min-width: 768px) {
  .hero-img {
    object-position: 65% center;
  }
}

.hero-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(10, 10, 12, 0.2) 0%,
    rgba(10, 10, 12, 0.62) 46%,
    #0A0A0C 100%
  );
}

@media (min-width: 768px) {
  .hero-scrim {
    background:
      linear-gradient(
        90deg,
        rgba(10, 10, 12, 0.94) 0%,
        rgba(10, 10, 12, 0.8) 38%,
        rgba(10, 10, 12, 0.24) 72%,
        rgba(10, 10, 12, 0.16) 100%
      ),
      linear-gradient(180deg, rgba(10, 10, 12, 0) 58%, #0A0A0C 100%);
  }
}

.hero-content {
  position: relative;
  z-index: 1;
}

.hero-copy {
  max-width: 680px;
  display: flex;
  flex-direction: column;
  gap: var(--sp-200);
}

.hero-title {
  color: #F4F4F5;
}

.hero-title-line {
  display: block;
}

.hero-title-line + .hero-title-line {
  color: #D4D4D8;
}

.hero-subtitle {
  max-width: 470px;
  color: #D4D4D8;
}

[data-theme="light"] .hero .btn-primary {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 0 0 1px rgba(255, 255, 255, 0.16);
}

@media (min-width: 768px) {
  .hero-subtitle {
    font-size: 18px;
    line-height: 28px;
  }
}

.hero-actions {
  padding-top: var(--sp-75);
}

/* ==========================================================================
   Общая раскладка секций
   ========================================================================== */

.section {
  padding-block: var(--sp-600);
}

@media (min-width: 1024px) {
  .section {
    padding-block: var(--sp-800);
  }
}

.section-head {
  display: flex;
  flex-direction: column;
  gap: var(--sp-75);
  margin-bottom: var(--sp-400);
  max-width: 680px;
}

.section-note {
  color: var(--text-muted);
}

/* ==========================================================================
   Секция 2: калькулятор
   ========================================================================== */

.calc-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--sp-400);
  align-items: start;
}

@media (min-width: 1024px) {
  .calc-layout {
    grid-template-columns: minmax(0, 1fr) 392px;
    gap: var(--sp-500);
  }
}

.calc-steps {
  display: flex;
  flex-direction: column;
  gap: var(--sp-500);
}

.step-block {
  display: flex;
  flex-direction: column;
}

.step-header {
  display: flex;
  align-items: center;
  gap: var(--sp-100);
  margin-bottom: var(--sp-200);
}

.step-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 28px;
  padding-inline: var(--sp-100);
  border-radius: var(--r-pill);
  background-color: var(--accent-soft);
  color: var(--accent-text);
  font-size: 13px;
  line-height: 16px;
  font-weight: 700;
}

/* Шаг 1: класс кузова */

.class-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--sp-100);
}

@media (max-width: 639px) {
  .class-grid {
    gap: var(--sp-75);
  }
}

.class-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--sp-100);
  min-height: 120px;
  padding: var(--sp-200);
  border-radius: var(--r-card-inner);
  border: 1px solid var(--border);
  background-color: var(--surface);
  box-shadow: var(--highlight);
  cursor: pointer;
  transition:
    background-color var(--dur-fast) var(--ease),
    border-color var(--dur-fast) var(--ease),
    box-shadow var(--dur-fast) var(--ease),
    transform var(--dur-fast) var(--ease);
}

.class-card:hover {
  background-color: var(--surface-2);
  border-color: var(--border-strong);
}

.class-card:active {
  transform: scale(0.985);
}

.class-card:has(input:focus-visible) {
  outline: 2px solid var(--accent-text);
  outline-offset: 3px;
}

.class-card.is-selected {
  background-color: var(--accent-tint);
  border-color: var(--accent-line);
  box-shadow: var(--highlight), 0 0 0 3px var(--accent-ring);
}

.class-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-75);
}

.class-silhouette {
  color: var(--text-muted);
  transition: color var(--dur-fast) var(--ease);
}

.class-card.is-selected .class-silhouette {
  color: var(--accent-text);
}

.class-indicator {
  width: 18px;
  height: 18px;
  border-radius: var(--r-pill);
  border: 2px solid var(--border-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: border-color var(--dur-fast) var(--ease);
}

.class-indicator::after {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: var(--r-pill);
  background-color: var(--accent-fill);
  opacity: 0;
  transform: scale(0.4);
  transition:
    opacity var(--dur-fast) var(--ease),
    transform var(--dur-fast) var(--ease);
}

.class-card.is-selected .class-indicator {
  border-color: var(--accent-fill);
}

.class-card.is-selected .class-indicator::after {
  opacity: 1;
  transform: scale(1);
}

.class-card-body {
  display: flex;
  flex-direction: column;
  gap: var(--sp-50);
  min-width: 0;
}

.class-label {
  font-size: 18px;
  line-height: 24px;
  font-weight: 700;
  color: var(--text);
  hyphens: none;
  overflow-wrap: normal;
  word-break: normal;
}

.class-examples {
  font-size: 14px;
  line-height: 20px;
  font-weight: 500;
  color: var(--text-muted);
  hyphens: none;
  overflow-wrap: normal;
  word-break: normal;
}

@media (max-width: 639px) {
  .class-card {
    min-height: 92px;
    gap: var(--sp-100);
    padding: 12px 10px;
    border-radius: var(--r-card-inner);
  }
  .class-silhouette {
    width: 32px;
    height: 15px;
  }
  .class-indicator {
    width: 16px;
    height: 16px;
  }
  .class-label {
    font-size: 12px;
    line-height: 16px;
    letter-spacing: -0.015em;
  }
  .class-examples {
    font-size: 11px;
    line-height: 15px;
  }
}

/* Шаг 2: услуги */

.services-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-100);
  border-radius: var(--r-card);
  transition: box-shadow var(--dur-fast) var(--ease);
}

.step-block.has-error .services-list {
  box-shadow: 0 0 0 2px var(--danger-line), 0 0 0 8px var(--danger-soft);
}

.service-card {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  align-items: start;
  gap: var(--sp-200);
  min-height: 76px;
  padding: var(--sp-200) var(--sp-300);
  border-radius: var(--r-card-inner);
  border: 1px solid var(--border);
  background-color: var(--surface);
  box-shadow: var(--highlight);
  cursor: pointer;
  transition:
    background-color var(--dur-fast) var(--ease),
    border-color var(--dur-fast) var(--ease),
    box-shadow var(--dur-fast) var(--ease),
    transform var(--dur-fast) var(--ease);
}

.service-card:hover {
  background-color: var(--surface-2);
  border-color: var(--border-strong);
}

.service-card:active {
  transform: scale(0.995);
}

.service-card:has(input:focus-visible) {
  outline: 2px solid var(--accent-text);
  outline-offset: 3px;
}

.service-card.is-selected {
  background-color: var(--accent-tint);
  border-color: var(--accent-line);
  box-shadow: var(--highlight), 0 0 0 3px var(--accent-ring);
}

.service-check {
  width: 22px;
  height: 22px;
  margin-top: 1px;
  border-radius: var(--r-check);
  border: 2px solid var(--border-strong);
  background-color: var(--surface);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-ink);
  transition:
    background-color var(--dur-fast) var(--ease),
    border-color var(--dur-fast) var(--ease);
}

.service-check svg {
  opacity: 0;
  transform: scale(0.7);
  transition:
    opacity var(--dur-fast) var(--ease),
    transform var(--dur-fast) var(--ease);
}

.service-card.is-selected .service-check {
  background-color: var(--accent-fill);
  border-color: var(--accent-fill);
}

.service-card.is-selected .service-check svg {
  opacity: 1;
  transform: scale(1);
}

.service-info {
  display: flex;
  flex-direction: column;
  gap: var(--sp-50);
  min-width: 0;
}

.service-title {
  font-size: 17px;
  line-height: 24px;
  font-weight: 600;
  color: var(--text);
}

.service-desc {
  font-size: 14px;
  line-height: 20px;
  font-weight: 500;
  color: var(--text-muted);
  text-wrap: pretty;
}

.service-pricing {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--sp-25);
  text-align: right;
  white-space: nowrap;
}

.service-price {
  font-size: 18px;
  line-height: 24px;
  font-weight: 700;
  color: var(--text);
}

.service-price-from {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
}

.service-card.is-selected .service-price {
  color: var(--accent-text);
}

.service-time {
  font-size: 13px;
  line-height: 16px;
  font-weight: 500;
  color: var(--text-muted);
}

@media (max-width: 520px) {
  .service-card {
    grid-template-columns: 22px minmax(0, 1fr);
    gap: var(--sp-100);
    padding: var(--sp-200);
  }
  .service-pricing {
    grid-column: 2;
    flex-direction: row;
    align-items: baseline;
    justify-content: space-between;
    text-align: left;
    padding-top: var(--sp-75);
    border-top: 1px solid var(--border);
  }
  .service-title {
    font-size: 16px;
  }
}

.inline-alert {
  margin-top: var(--sp-200);
  padding: var(--sp-100) var(--sp-200);
  border-radius: var(--r-control);
  border: 1px solid var(--danger-line);
  background-color: var(--danger-soft);
  color: var(--danger-text);
  font-weight: 600;
}

/* Шаг 3: форма */

.details-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--sp-200);
}

@media (min-width: 640px) {
  .details-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.field {
  display: flex;
  flex-direction: column;
  gap: var(--sp-75);
  min-width: 0;
}

.field-full {
  grid-column: 1 / -1;
}

.field-label {
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
  color: var(--text);
}

.label-optional,
.field-hint {
  font-size: 13px;
  line-height: 18px;
  font-weight: 500;
  color: var(--text-muted);
}

.input {
  width: 100%;
  min-height: 52px;
  padding: var(--sp-100) var(--sp-200);
  border-radius: var(--r-control);
  border: 1px solid var(--border-strong);
  background-color: var(--surface);
  box-shadow: var(--highlight);
  color: var(--text);
  font-size: 16px;
  line-height: 24px;
  font-weight: 600;
  transition:
    border-color var(--dur-fast) var(--ease),
    background-color var(--dur-fast) var(--ease),
    box-shadow var(--dur-fast) var(--ease);
}

.input::placeholder {
  color: var(--text-muted);
  font-weight: 500;
  opacity: 0.8;
}

.input:hover {
  border-color: var(--border-hover);
}

.input:focus {
  outline: none;
  border-color: var(--accent-text);
  background-color: var(--surface-2);
  box-shadow: var(--highlight), 0 0 0 3px var(--accent-ring);
}

.input::-webkit-calendar-picker-indicator {
  filter: invert(0.75);
  cursor: pointer;
}

[data-theme="light"] .input::-webkit-calendar-picker-indicator {
  filter: none;
}

.textarea {
  min-height: 88px;
  resize: vertical;
}

/* Липкая колонка расчёта */

.summary-column {
  min-width: 0;
}

@media (min-width: 1024px) {
  .summary-column {
    position: sticky;
    top: var(--sp-400);
  }
}

.summary-card {
  display: flex;
  flex-direction: column;
  gap: var(--sp-300);
  padding: var(--sp-300);
  border-radius: var(--r-card);
  border: 1px solid var(--border);
  background-color: var(--surface);
  box-shadow: var(--highlight), var(--shadow-card);
}

.summary-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-100);
}

.summary-title {
  font-size: 20px;
  line-height: 28px;
  font-weight: 800;
}

.summary-class {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: var(--sp-50) var(--sp-100);
  border-radius: var(--r-pill);
  background-color: var(--accent-soft);
  color: var(--accent-text);
  font-size: 13px;
  line-height: 16px;
  font-weight: 700;
  white-space: nowrap;
}

.summary-items {
  display: flex;
  flex-direction: column;
  gap: var(--sp-100);
  min-height: 48px;
}

.summary-empty {
  color: var(--text-muted);
}

.summary-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-200);
}

.summary-item-name {
  font-size: 15px;
  line-height: 20px;
  font-weight: 600;
  color: var(--text);
  min-width: 0;
}

.summary-item-price {
  font-size: 15px;
  line-height: 20px;
  font-weight: 600;
  color: var(--text-soft);
  white-space: nowrap;
  flex-shrink: 0;
}

.summary-totals {
  display: flex;
  flex-direction: column;
  gap: var(--sp-75);
  padding: var(--sp-200);
  border-radius: var(--r-control-lg);
  background-color: var(--totals-bg);
  border: 1px solid var(--border);
}

.total-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-200);
}

.total-label {
  font-size: 15px;
  line-height: 20px;
  font-weight: 600;
  color: var(--text-soft);
}

.total-label-sub {
  font-size: 14px;
  line-height: 20px;
  font-weight: 500;
  color: var(--text-muted);
}

.total-price {
  font-size: 30px;
  line-height: 36px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--text);
  white-space: nowrap;
}

.total-time {
  font-size: 15px;
  line-height: 20px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}

.summary-actions {
  display: flex;
  flex-direction: column;
  gap: var(--sp-100);
}

.trust-line {
  padding-top: var(--sp-50);
  font-size: 13px;
  line-height: 18px;
  font-weight: 500;
  color: var(--text-muted);
  text-align: center;
  text-wrap: balance;
}

/* ==========================================================================
   Секция 3: примеры работ
   ========================================================================== */

.portfolio-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--sp-300);
}

@media (min-width: 768px) {
  .portfolio-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.portfolio-card {
  display: flex;
  flex-direction: column;
  padding: 0;
  text-align: left;
  border-radius: var(--r-card);
  border: 1px solid var(--border);
  background-color: var(--surface);
  box-shadow: var(--highlight);
  overflow: hidden;
  transition:
    border-color var(--dur-fast) var(--ease),
    transform var(--dur-fast) var(--ease);
}

.portfolio-card:hover {
  border-color: var(--border-strong);
}

.portfolio-card:active {
  transform: scale(0.99);
}

.portfolio-media {
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background-color: var(--surface-2);
}

.portfolio-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--dur-base) var(--ease);
}

.portfolio-card:hover .portfolio-img {
  transform: scale(1.03);
}

.portfolio-caption {
  display: flex;
  flex-direction: column;
  gap: var(--sp-50);
  padding: var(--sp-200) var(--sp-300) var(--sp-300);
}

.portfolio-car {
  font-size: 18px;
  line-height: 24px;
  font-weight: 700;
  color: var(--text);
}

.portfolio-work {
  font-size: 14px;
  line-height: 20px;
  font-weight: 500;
  color: var(--text-muted);
}

/* ==========================================================================
   Секция 4: футер
   ========================================================================== */

.site-footer {
  border-top: 1px solid var(--border);
  padding-block: var(--sp-600) var(--sp-700);
}

@media (max-width: 1023px) {
  .site-footer {
    padding-bottom: var(--sp-900);
  }
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: var(--sp-400);
}

@media (min-width: 768px) {
  .footer-inner {
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
  }
}

.footer-info {
  display: flex;
  flex-direction: column;
  gap: var(--sp-200);
}

.footer-brand {
  display: flex;
  align-items: baseline;
  gap: var(--sp-100);
}

.footer-name {
  font-size: 20px;
  line-height: 28px;
  font-weight: 800;
}

.footer-city {
  font-size: 14px;
  line-height: 20px;
  font-weight: 500;
  color: var(--text-muted);
}

.footer-meta {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--sp-75);
}

.footer-meta-row {
  display: flex;
  align-items: baseline;
  gap: var(--sp-200);
}

.footer-meta dt {
  width: 72px;
  flex-shrink: 0;
  font-size: 13px;
  line-height: 18px;
  font-weight: 500;
  color: var(--text-muted);
}

.footer-meta dd {
  margin: 0;
  font-size: 15px;
  line-height: 20px;
  font-weight: 600;
}

.footer-phone {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-block: -12px;
  transition: color var(--dur-fast) var(--ease);
}

.footer-phone:hover {
  color: var(--accent-text);
}

.footer-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--sp-100);
}

@media (min-width: 768px) {
  .footer-actions {
    align-items: flex-end;
  }
}

.owner-link {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-75);
  min-height: 44px;
  padding-inline: var(--sp-100);
  border-radius: var(--r-pill);
  font-size: 13px;
  line-height: 16px;
  font-weight: 500;
  color: var(--text-muted);
  transition: color var(--dur-fast) var(--ease);
}

.owner-link:hover {
  color: var(--text);
}

/* ==========================================================================
   Мобильная нижняя панель
   ========================================================================== */

.mobile-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  background-color: var(--mobile-bar-bg);
  border: 1px solid var(--border-strong);
  border-bottom: 0;
  border-radius: var(--r-card) var(--r-card) 0 0;
  box-shadow: var(--highlight), var(--shadow-bar);
  padding: var(--sp-100) var(--sp-200) calc(var(--sp-100) + env(safe-area-inset-bottom, 0px));
  transition:
    transform var(--dur-base) var(--ease),
    opacity var(--dur-fast) var(--ease);
}

.mobile-bar.is-hidden {
  transform: translateY(110%);
  opacity: 0;
  pointer-events: none;
}

@media (min-width: 1024px) {
  .mobile-bar {
    display: none;
  }
}

.mobile-bar-inner {
  max-width: var(--container-max);
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-200);
}

.mobile-bar-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.mobile-bar-price {
  font-size: 20px;
  line-height: 28px;
  font-weight: 800;
}

.mobile-bar-meta {
  font-size: 13px;
  line-height: 16px;
  font-weight: 500;
  color: var(--text-muted);
}

/* ==========================================================================
   Модалки: лайтбокс и панель владельца
   ========================================================================== */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background-color: var(--overlay-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-200);
}

#lightbox.modal-overlay {
  background-color: rgba(10, 10, 12, 0.92);
  color: #F4F4F5;
}

.modal-overlay[hidden] {
  display: none;
}

.lightbox-dialog {
  width: 100%;
  max-width: 960px;
  display: flex;
  flex-direction: column;
  gap: var(--sp-200);
}

.lightbox-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.lightbox-counter {
  font-size: 14px;
  font-weight: 600;
  color: #D4D4D8;
}

#lightbox .icon-btn {
  background-color: #1B1B22;
  border-color: rgba(255, 255, 255, 0.18);
  color: #F4F4F5;
  box-shadow: none;
}

#lightbox .icon-btn:hover {
  background-color: #272732;
}

.lightbox-stage {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--sp-100);
}

.lightbox-img {
  width: 100%;
  max-height: 70svh;
  object-fit: contain;
  border-radius: var(--r-card);
  border: 1px solid rgba(255, 255, 255, 0.12);
  background-color: #141418;
}

.lightbox-caption {
  display: flex;
  flex-direction: column;
  gap: var(--sp-50);
  text-align: center;
  color: #F4F4F5;
}

.lightbox-caption p {
  color: #D4D4D8;
}

@media (max-width: 639px) {
  .lightbox-stage {
    grid-template-columns: minmax(0, 1fr);
    position: relative;
  }
  .lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
  }
  #lightbox-prev {
    left: var(--sp-75);
  }
  #lightbox-next {
    right: var(--sp-75);
  }
}

/* Панель владельца */

.admin-panel {
  width: 100%;
  max-width: 840px;
  max-height: 92svh;
  display: flex;
  flex-direction: column;
  border-radius: var(--r-card);
  border: 1px solid var(--border-strong);
  background-color: var(--surface);
  box-shadow: var(--highlight), var(--shadow-modal);
  overflow: hidden;
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-200);
  padding: var(--sp-200) var(--sp-300);
  border-bottom: 1px solid var(--border);
}

.admin-slug-note {
  margin-top: var(--sp-25);
  font-size: 13px;
  line-height: 18px;
  font-weight: 500;
  color: var(--text-muted);
}

.admin-pin-screen {
  display: flex;
  flex-direction: column;
  gap: var(--sp-200);
  padding: var(--sp-400) var(--sp-300);
  max-width: 420px;
  width: 100%;
  margin-inline: auto;
}

.admin-pin-screen > p {
  color: var(--text-muted);
}

.admin-editor {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
}

.admin-editor[hidden],
.admin-pin-screen[hidden] {
  display: none;
}

.admin-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--sp-300);
  display: flex;
  flex-direction: column;
  gap: var(--sp-400);
}

.admin-group {
  display: flex;
  flex-direction: column;
  gap: var(--sp-200);
}

.admin-group + .admin-group {
  padding-top: var(--sp-400);
  border-top: 1px solid var(--border);
}

.admin-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-200);
  flex-wrap: wrap;
}

.admin-group-title {
  font-size: 17px;
  line-height: 24px;
  font-weight: 700;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--sp-200);
}

@media (min-width: 640px) {
  .admin-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.admin-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-100);
}

.admin-row-card {
  display: flex;
  flex-direction: column;
  gap: var(--sp-200);
  padding: var(--sp-200);
  border-radius: var(--r-card-inner);
  border: 1px solid var(--border);
  background-color: var(--bg);
  box-shadow: var(--highlight);
}

.admin-row-card .input {
  min-height: 48px;
  font-size: 15px;
}

.admin-class-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) 120px;
  gap: var(--sp-100);
  align-items: end;
}

@media (max-width: 639px) {
  .admin-class-row {
    grid-template-columns: minmax(0, 1fr) 104px;
  }
  .admin-class-row .field-examples {
    grid-column: 1 / -1;
    order: 3;
  }
}

.admin-service-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-100);
  flex-wrap: wrap;
}

.admin-toggles {
  display: flex;
  align-items: center;
  gap: var(--sp-200);
  flex-wrap: wrap;
}

.admin-checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-75);
  min-height: 44px;
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
  cursor: pointer;
}

.admin-checkbox-label input {
  width: 20px;
  height: 20px;
  border-radius: var(--r-check);
  accent-color: var(--accent-fill);
}

.admin-service-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--sp-100);
}

@media (min-width: 640px) {
  .admin-service-grid {
    grid-template-columns: minmax(0, 2fr) 140px 104px;
  }
}

.color-field {
  display: flex;
  align-items: center;
  gap: var(--sp-100);
  flex-wrap: wrap;
}

.color-field .input {
  flex: 1 1 130px;
}

.accent-preview {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-100);
  min-height: 52px;
  padding: var(--sp-75) var(--sp-200);
  border-radius: var(--r-control);
  border: 1px solid var(--border-strong);
  background-color: var(--surface);
}

.accent-preview-btn {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding-inline: var(--sp-100);
  border-radius: 10px;
  font-size: 13px;
  line-height: 16px;
  font-weight: 700;
}

.accent-preview-text {
  font-size: 14px;
  line-height: 20px;
  font-weight: 700;
  white-space: nowrap;
}

.color-swatch {
  width: 52px;
  height: 52px;
  padding: var(--sp-50);
  border-radius: var(--r-control);
  border: 1px solid var(--border-strong);
  background-color: var(--surface);
  cursor: pointer;
  flex-shrink: 0;
}

.color-swatch::-webkit-color-swatch-wrapper {
  padding: 0;
}

.color-swatch::-webkit-color-swatch {
  border: 0;
  border-radius: 10px;
}

/* Блок управления фото */

.media-control {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr);
  gap: var(--sp-200);
  align-items: start;
}

@media (max-width: 479px) {
  .media-control {
    grid-template-columns: 96px minmax(0, 1fr);
    gap: var(--sp-100);
  }
}

.media-thumb {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--r-control);
  border: 1px solid var(--border-strong);
  background-color: var(--surface-2);
}

.media-control.is-hero .media-thumb {
  aspect-ratio: 16 / 9;
}

.media-fields {
  display: flex;
  flex-direction: column;
  gap: var(--sp-75);
  min-width: 0;
}

.media-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-100);
  flex-wrap: wrap;
}

.media-status {
  font-size: 13px;
  line-height: 18px;
  font-weight: 500;
  color: var(--text-muted);
}

.media-status.is-error {
  color: var(--danger-text);
}

.admin-footer {
  display: flex;
  flex-direction: column;
  gap: var(--sp-100);
  padding: var(--sp-200) var(--sp-300);
  border-top: 1px solid var(--border);
  background-color: var(--bg);
}

.admin-status {
  font-size: 14px;
  line-height: 20px;
  font-weight: 500;
  color: var(--text-muted);
}

.admin-status:empty {
  display: none;
}

.admin-status.is-error {
  color: var(--danger-text);
}

.admin-footer-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-75);
}

.admin-footer-actions #adm-apply {
  grid-column: 1 / -1;
}

@media (min-width: 640px) {
  .admin-footer-actions {
    display: flex;
    gap: var(--sp-100);
  }
  .admin-footer-actions .btn {
    flex: 1 1 180px;
    min-height: 48px;
  }
}

@media (max-width: 639px) {
  .admin-header,
  .admin-footer {
    padding: var(--sp-100) var(--sp-200);
  }
  .admin-body {
    padding: var(--sp-200);
  }
  .modal-overlay {
    padding: var(--sp-100);
  }
}

/* Тост */

.toast {
  position: fixed;
  left: 50%;
  bottom: var(--sp-400);
  transform: translateX(-50%);
  z-index: 120;
  max-width: calc(100vw - 32px);
  padding: var(--sp-100) var(--sp-300);
  border-radius: var(--r-pill);
  border: 1px solid var(--accent-line);
  background-color: var(--toast-bg);
  box-shadow: var(--highlight), var(--shadow-toast);
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
  text-align: center;
}

.toast[hidden] {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
