/* ==========================================================================
   Служба уборки «Пена» — стили одностраничного сайта
   ========================================================================== */

:root {
  /* Палитра построена на фирменных цветах логотипа */
  --brand: #3961a8;
  --brand-dark: #2b4c85;
  --brand-deep: #1e3050;
  --cream: #f3ebe0;
  --cream-soft: #faf5ee;
  --white: #ffffff;
  --ink: #17233a;
  --muted: #66748b;
  --line: #e3d9cb;
  --accent: #e8b647;

  --radius-sm: 10px;
  --radius: 18px;
  --radius-lg: 28px;

  --shadow-sm: 0 2px 8px rgba(30, 48, 80, .06);
  --shadow: 0 10px 30px rgba(30, 48, 80, .08);
  --shadow-lg: 0 24px 60px rgba(30, 48, 80, .14);

  --space: clamp(56px, 8vw, 104px);
  --font: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;

  --header-h: 72px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--cream-soft);
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--brand); }
h1, h2, h3, h4 { line-height: 1.18; margin: 0 0 .5em; font-weight: 700; letter-spacing: -.015em; }
h1 { font-size: clamp(30px, 5.2vw, 52px); }
h2 { font-size: clamp(26px, 3.6vw, 38px); }
h3 { font-size: clamp(19px, 2vw, 22px); }
h4 { font-size: 16px; text-transform: uppercase; letter-spacing: .08em; color: var(--brand); margin-top: 1.4em; }
p { margin: 0 0 1em; }
ul { margin: 0 0 1em; padding-left: 1.2em; }

:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 3px;
  border-radius: 4px;
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  background: var(--brand); color: #fff; padding: 10px 18px;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm); text-decoration: none;
  transition: top .2s;
}
.skip-link:focus { top: 0; }

.container {
  width: 100%;
  max-width: 1180px;
  margin-inline: auto;
  padding-inline: 20px;
}
.container--narrow { max-width: 800px; }

section { padding-block: var(--space); }
.section__lead {
  max-width: 62ch;
  color: var(--muted);
  font-size: clamp(16px, 1.6vw, 19px);
  margin-bottom: 2.2em;
}

/* --------------------------------------------------------------- Кнопки */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 15px 28px;
  border: 2px solid transparent;
  border-radius: 999px;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform .15s ease, background-color .2s, color .2s, box-shadow .2s;
}
.btn--primary { position: relative; overflow: hidden; background: var(--brand); color: #fff; box-shadow: 0 8px 22px rgba(57, 97, 168, .28); }
.btn--primary:hover { background: var(--brand-dark); transform: translateY(-2px); }
.btn--primary::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 40%, rgba(255, 255, 255, .35) 50%, transparent 60%);
  transform: translateX(-100%);
  transition: transform .5s ease;
}
.btn--primary:hover::after { transform: translateX(100%); }
.btn--ghost { background: transparent; color: var(--brand-deep); border-color: var(--brand); }
.btn--ghost:hover { background: rgba(57, 97, 168, .08); }
.btn--sm { padding: 11px 20px; font-size: 15px; }
.btn--wide { width: 100%; }
.btn[disabled] { opacity: .6; cursor: progress; transform: none; }

/* -------------------------------------------------------------- Шапка */

.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 245, 238, .92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header__inner {
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: var(--header-h);
}
.header__logo { flex: none; line-height: 0; }
.header__logo img { width: 150px; height: auto; }

.nav { margin-left: auto; }
.nav__list {
  display: flex;
  gap: 22px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav__list a {
  color: var(--ink);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  padding: 6px 0;
  border-bottom: 2px solid transparent;
}
.nav__list a:hover { color: var(--brand); }
.nav__list a.is-active { color: var(--brand); border-bottom-color: var(--brand); }

.header__actions { display: flex; align-items: center; gap: 14px; }
.header__phones { display: flex; flex-direction: column; gap: 2px; }
.header__phone {
  font-weight: 700;
  color: var(--brand-deep);
  text-decoration: none;
  white-space: nowrap;
}
.header__phone:hover { color: var(--brand); }

.burger {
  display: none;
  width: 44px; height: 44px;
  border: 0; background: transparent; cursor: pointer;
  padding: 10px;
}
.burger span {
  display: block; height: 2px; background: var(--brand-deep);
  border-radius: 2px; transition: transform .25s, opacity .2s;
}
.burger span + span { margin-top: 6px; }
.burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* ---------------------------------------------------------------- Hero */

.hero {
  position: relative;
  background: linear-gradient(170deg, var(--cream) 0%, var(--cream-soft) 72%);
  overflow: hidden;
  padding-block: clamp(48px, 7vw, 96px) var(--space);
}
.hero__inner { position: relative; z-index: 1; max-width: 760px; }
.hero__eyebrow {
  text-transform: uppercase;
  letter-spacing: .16em;
  font-size: 13px;
  font-weight: 600;
  color: var(--brand);
  margin-bottom: 14px;
}
.hero__lead { font-size: clamp(17px, 1.9vw, 20px); color: var(--muted); max-width: 58ch; }
.hero__points {
  list-style: none;
  padding: 0;
  margin: 28px 0;
  display: grid;
  gap: 12px;
}
.hero__points li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: rgba(255, 255, 255, .7);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 16px;
}
.hero__ico { flex: none; font-size: 20px; line-height: 1.3; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 18px; }
.hero__note { font-size: 15px; color: var(--muted); margin: 0; }

/* Пузыри на фоне героя */
.bubbles { position: absolute; inset: 0; pointer-events: none; }
.bubbles span {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, .9), rgba(57, 97, 168, .18));
  border: 1px solid rgba(57, 97, 168, .16);
  animation: float 14s ease-in-out infinite;
}
.bubbles span:nth-child(1) { width: 190px; height: 190px; right: -40px; top: 8%; }
.bubbles span:nth-child(2) { width: 110px; height: 110px; right: 16%; top: 48%; animation-delay: -3s; }
.bubbles span:nth-child(3) { width: 64px;  height: 64px;  right: 6%;  bottom: 12%; animation-delay: -6s; }
.bubbles span:nth-child(4) { width: 140px; height: 140px; right: 28%; top: -40px; animation-delay: -9s; }
.bubbles span:nth-child(5) { width: 46px;  height: 46px;  right: 34%; bottom: 22%; animation-delay: -2s; }
.bubbles span:nth-child(6) { width: 86px;  height: 86px;  right: -20px; bottom: 34%; animation-delay: -7s; }

@keyframes float {
  0%, 100% { transform: translateY(0) scale(1); }
  50%      { transform: translateY(-22px) scale(1.04); }
}

/* --------------------------------------------------------------- Сетки */

.grid { display: grid; gap: 20px; }
.grid--2 { grid-template-columns: 1fr; }
@media (min-width: 760px) { .grid--2 { grid-template-columns: repeat(2, 1fr); } }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); }

.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow-sm);
  transition: transform .18s ease, box-shadow .18s ease;
}
.card p:last-child { margin-bottom: 0; }
.card--service:hover, .card--value:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.card--service { overflow: hidden; }
.card__photo { margin: -26px -26px 16px; }
.card__photo img { width: 100%; height: auto; aspect-ratio: 16/10; object-fit: cover; display: block; }
.card__ico { font-size: 26px; display: block; margin-bottom: 10px; }
.card__link {
  display: inline-block;
  margin-top: 6px;
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  border-bottom: 1px solid rgba(57, 97, 168, .35);
}
.card__link:hover { border-bottom-color: var(--brand); }
.card--accent { background: linear-gradient(160deg, var(--cream) 0%, var(--white) 80%); border-color: var(--brand); }

.reveal { opacity: 0; transform: translateY(16px); transition: opacity .5s ease, transform .5s ease; }
.reveal.is-visible { opacity: 1; transform: none; }

.value { background: var(--white); }
.card--value h3 { color: var(--brand-deep); }

/* ----------------------------------------------------------- Аккордеон */

.accordion { display: grid; gap: 12px; }
.acc {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.acc summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  cursor: pointer;
  font-weight: 600;
  font-size: clamp(16px, 1.8vw, 18px);
  list-style: none;
}
.acc summary::-webkit-details-marker { display: none; }
.acc summary::after {
  content: "";
  flex: none;
  width: 12px; height: 12px;
  border-right: 2px solid var(--brand);
  border-bottom: 2px solid var(--brand);
  transform: rotate(45deg) translate(-2px, -2px);
  transition: transform .2s ease;
}
.acc[open] summary::after { transform: rotate(-135deg) translate(-2px, -2px); }
.acc[open] summary { background: var(--cream); }
.acc__body { padding: 6px 22px 22px; }
.acc__body h4:first-child { margin-top: 0; }
.acc__body ul { margin-bottom: .8em; }
.acc__body li { margin-bottom: .25em; }
.acc__note {
  background: var(--cream);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 12px 16px;
  font-size: 15px;
  color: var(--muted);
}
.acc__excl { color: #b4553d; }
.list--excl { color: var(--muted); }

/* -------------------------------------------------------------- Прайс */

.prices { background: var(--white); }
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--line); }
.price-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 420px;
  background: var(--white);
}
.price-table th, .price-table td { padding: 16px 22px; text-align: left; }
.price-table thead th { background: var(--brand-deep); color: #fff; font-size: 15px; letter-spacing: .02em; }
.price-table tbody tr + tr td { border-top: 1px solid var(--line); }
.price-table tbody tr:nth-child(even) { background: var(--cream-soft); }
.price-table tbody tr:hover td { background: rgba(57, 97, 168, .08); transition: background-color .18s; }
.price-table td:last-child { font-weight: 700; color: var(--brand-deep); white-space: nowrap; }
.price-table__group th { background: var(--cream-soft); color: var(--brand-deep); font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: .02em; }
.price-table__group + tr td { border-top: none; }

.prices__cta {
  margin-top: 28px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
  justify-content: space-between;
  background: var(--cream);
  border-radius: var(--radius);
  padding: 24px 28px;
}
.prices__cta p { margin: 0; max-width: 52ch; font-weight: 500; }

/* --------------------------------------------------------------- Шаги */

.steps__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  counter-reset: step;
}
.steps__item {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow-sm);
}
.steps__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  margin-bottom: 14px;
}
.steps__item p { margin-bottom: 0; color: var(--muted); }

/* ------------------------------------------------------------ Галерея */

.works { background: var(--white); }
.gallery {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}
.gallery__item {
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--cream);
  cursor: zoom-in;
  box-shadow: var(--shadow-sm);
  transition: transform .18s ease, box-shadow .18s ease;
}
.gallery__item:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.gallery__item img {
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 4;
  object-fit: contain;
  background: var(--cream);
}

/* ------------------------------------------------------------- Отзывы */

.quotes {
  display: grid;
  gap: 20px;
  grid-template-columns: 1fr;
}
@media (min-width: 760px) { .quotes { grid-template-columns: repeat(2, 1fr); } }
.quote {
  margin: 0;
  background: var(--white);
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand);
  border-radius: var(--radius);
  padding: 24px 26px;
  box-shadow: var(--shadow-sm);
}
.quote blockquote { margin: 0 0 12px; font-size: 16px; }
.quote blockquote p { margin: 0; }
.quote__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.quote__author { font-size: 14px; color: var(--muted); font-weight: 600; }
.quote__proof {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--brand);
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: zoom-in;
  transition: background-color .18s, color .18s;
}
.quote__proof:hover { background: var(--brand); color: #fff; border-color: var(--brand); }

.why { background: var(--white); }
.card--why h3 { color: var(--brand-deep); }

/* -------------------------------------------------------------- Форма */

.order { background: linear-gradient(180deg, var(--cream) 0%, var(--cream-soft) 100%); }
.form {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(22px, 4vw, 36px);
  box-shadow: var(--shadow);
}
.form__row { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.field { display: block; margin-bottom: 18px; }
.field__label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.field__label span { color: #c0563c; }
.field__input {
  width: 100%;
  padding: 13px 16px;
  font: inherit;
  font-size: 16px;
  color: var(--ink);
  background: var(--cream-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  transition: border-color .18s, box-shadow .18s, background-color .18s;
}
.field__input:focus {
  background: var(--white);
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(57, 97, 168, .16);
  outline: none;
}
textarea.field__input { resize: vertical; min-height: 110px; }
select.field__input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--brand) 50%), linear-gradient(135deg, var(--brand) 50%, transparent 50%); background-position: calc(100% - 20px) 22px, calc(100% - 14px) 22px; background-size: 6px 6px, 6px 6px; background-repeat: no-repeat; padding-right: 42px; }

.field__error {
  display: block;
  min-height: 0;
  font-size: 13px;
  color: #c0563c;
  margin-top: 5px;
}
.field__input[aria-invalid="true"] { border-color: #c0563c; background: #fdf4f2; }

.checkbox { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; margin-top: 4px; }
.checkbox input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--brand); flex: none; }
.checkbox span span { color: #c0563c; }

.form__hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form .btn--wide { margin-top: 20px; }
.form__status { margin: 14px 0 0; font-size: 15px; font-weight: 600; min-height: 1.4em; }
.form__status.is-ok { color: #2c7a4b; }
.form__status.is-error { color: #c0563c; }

/* -------------------------------------------------------------- Подвал */

.footer {
  background: var(--brand-deep);
  color: #d8e0ee;
  padding-block: var(--space) 28px;
}
.footer__inner {
  display: grid;
  gap: 34px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.footer__logo {
  width: 170px;
  background: var(--cream);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
}
.footer__tagline { margin-top: 16px; color: #b8c4d8; max-width: 34ch; }
.footer__title { font-size: 17px; color: #fff; margin-bottom: 14px; }
.footer__note { font-size: 14px; color: #9fb0ca; margin-bottom: 8px; }
.footer__list { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 8px; }
.footer__list--inline { display: flex; flex-wrap: wrap; gap: 16px; }
.footer__list a { color: #fff; text-decoration: none; font-weight: 600; }
.footer__list a:hover { color: var(--accent); }
.footer__bottom {
  margin-top: 40px;
  padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, .14);
  font-size: 13px;
  color: #9fb0ca;
}
.footer__bottom p { margin: 0 0 6px; }
.footer__small { font-size: 12px; color: #8496b3; }

/* ---------------------------------------------------------- Лайтбокс */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.lightbox[hidden] { display: none !important; }
.lightbox__backdrop { position: absolute; inset: 0; background: rgba(23, 35, 58, .82); }
.lightbox__figure {
  position: relative;
  margin: 0;
  max-width: min(560px, 100%);
  max-height: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.lightbox__img {
  max-height: calc(100vh - 140px);
  width: auto;
  margin-inline: auto;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  background: var(--cream);
}
.lightbox__caption { color: #fff; font-size: 14px; text-align: center; }
.lightbox__close {
  position: absolute;
  top: -46px; right: 0;
  width: 40px; height: 40px;
  border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .16);
  color: #fff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}
.lightbox__close:hover { background: rgba(255, 255, 255, .3); }

/* ------------------------------------------------------- Адаптивность */

@media (max-width: 980px) {
  .nav {
    position: fixed;
    inset: var(--header-h) 0 auto;
    background: var(--cream-soft);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow);
    padding: 12px 20px 20px;
    display: none;
  }
  .nav.is-open { display: block; }
  .nav__list { flex-direction: column; gap: 0; }
  .nav__list a { display: block; padding: 13px 0; border-bottom: 1px solid var(--line); }
  .nav__list a.is-active { border-bottom-color: var(--line); }
  .burger { display: block; margin-left: auto; }
  .header__actions { margin-left: 0; }
  .header__actions .btn { display: none; }
}

@media (max-width: 620px) {
  body { font-size: 16px; }
  .header__logo img { width: 124px; }
  .header__phone { font-size: 14px; }
  .prices__cta { flex-direction: column; align-items: flex-start; }
  .prices__cta .btn { width: 100%; }
  .gallery { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .bubbles span:nth-child(2),
  .bubbles span:nth-child(5),
  .bubbles span:nth-child(6) { display: none; }
  .bubbles span { opacity: .55; }
  .acc summary { padding: 16px 18px; }
  .acc__body { padding: 4px 18px 18px; }
}

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

@media print {
  .header, .burger, .lightbox, .hero__cta, .bubbles { display: none !important; }
  body { background: #fff; }
}
