/* ==========================================================================
   ООО «Светофор+» — стили сайта
   Никаких внешних зависимостей: без jQuery, без CDN, без подключаемых шрифтов.
   Вёрстка mobile-first, раскладка на flex/grid.
   ========================================================================== */

/* --- Токены ------------------------------------------------------------- */

:root {
  --dark:      #151d26;
  --dark-2:    #1e2836;
  --ink:       #1f242b;
  --body:      #414951;
  --muted:     #6b7480;
  --line:      #e3e7eb;
  --bg:        #ffffff;
  --bg-alt:    #f5f7f9;
  --accent:    #f5b301;   /* жёлтый светофора */
  --red:       #e0483d;
  --green:     #2f9e52;
  --focus:     #2f6fd0;

  --wrap:      1120px;
  --radius:    12px;
  --shadow:    0 1px 2px rgba(21, 29, 38, .05), 0 8px 24px rgba(21, 29, 38, .06);

  --section-y: clamp(2.75rem, 6vw, 5rem);
  --gap:       clamp(1rem, 2vw, 1.5rem);
}

/* --- База --------------------------------------------------------------- */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 7rem;     /* чтобы якорь не уезжал под липкую шапку */
  -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--body);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: clamp(1rem, .95rem + .25vw, 1.0625rem);
  line-height: 1.6;
  overflow-x: clip;             /* страховка от горизонтального скролла; clip, а не hidden, — иначе ломается sticky */
}

h1, h2, h3, h4 { color: var(--ink); line-height: 1.2; margin: 0; text-wrap: balance; }
p { margin: 0 0 1rem; }
p:last-child { margin-bottom: 0; }
img { max-width: 100%; height: auto; display: block; }

a { color: inherit; }

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

.wrap {
  width: min(var(--wrap), 100% - 2rem);
  margin-inline: auto;
}

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

.skip-link {
  position: absolute;
  left: 1rem; top: -100%;
  z-index: 100;
  padding: .75rem 1.25rem;
  background: var(--accent);
  color: var(--dark);
  font-weight: 700;
  text-decoration: none;
  border-radius: 0 0 var(--radius) var(--radius);
}
.skip-link:focus { top: 0; }

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

.btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .1rem;
  padding: .7rem 1.15rem;
  border-radius: 10px;
  font-weight: 700;
  font-size: .95rem;
  line-height: 1.25;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color .18s ease, color .18s ease, transform .18s ease;
}
.btn:hover { transform: translateY(-1px); }

.btn--call    { background: var(--accent); color: var(--dark); }
.btn--call:hover { background: #ffc42a; }
.btn__label   { font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; opacity: .75; }
.btn__phone   { font-size: 1rem; }

.btn--primary { background: var(--accent); color: var(--dark); }
.btn--primary:hover { background: #ffc42a; }
.btn--ghost   { background: rgba(255, 255, 255, .08); color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .3); }
.btn--ghost:hover { background: rgba(255, 255, 255, .16); }

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--dark);
  color: #fff;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .08);
}

.head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem 1.5rem;
  padding-block: .6rem;
}

.brand {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: #fff;
  margin-right: auto;
}
.brand__name     { font-size: clamp(1.15rem, 1rem + 1vw, 1.55rem); font-weight: 700; letter-spacing: -.01em; }
.brand__code     { color: var(--accent); font-weight: 600; }
.brand__director { font-size: .8rem; color: rgba(255, 255, 255, .65); }

.nav { order: 3; width: 100%; }
.nav ul {
  display: flex;
  flex-wrap: nowrap;
  gap: 1.15rem;
  margin: 0;
  padding: .15rem 0 .35rem;
  list-style: none;
  overflow-x: auto;                 /* на узком экране меню прокручивается вбок */
  scrollbar-width: none;
}
.nav ul::-webkit-scrollbar { display: none; }
.nav a {
  display: inline-block;
  color: rgba(255, 255, 255, .82);
  font-size: .95rem;
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: color .18s ease, border-color .18s ease;
}
.nav a:hover { color: #fff; border-bottom-color: var(--accent); }

@media (min-width: 70rem) {
  html { scroll-padding-top: 5.5rem; }
  .head { flex-wrap: nowrap; padding-block: .75rem; }
  .nav  { order: 0; width: auto; min-width: 0; margin-left: auto; }
  .nav ul { padding: 0; }
  .brand { flex-shrink: 0; }
  .brand__name,
  .brand__director { white-space: nowrap; }
}

/* --- Первый экран ------------------------------------------------------- */

.hero {
  color: #fff;
  background:
    radial-gradient(circle at 14% 20%, rgba(224, 72, 61, .30), transparent 46%),
    radial-gradient(circle at 52% -8%, rgba(245, 179, 1, .26), transparent 52%),
    radial-gradient(circle at 88% 34%, rgba(47, 158, 82, .28), transparent 46%),
    linear-gradient(165deg, var(--dark-2), var(--dark) 65%);
}

.hero__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  min-height: min(72vh, 34rem);
  padding-block: clamp(3rem, 9vw, 6rem);
  text-align: center;
}

.hero__eyebrow {
  margin: 0;
  font-size: .85rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .7);
}

.hero__title {
  margin: 0;
  font-size: clamp(2.1rem, 1.2rem + 5vw, 4.25rem);
  font-weight: 800;
  letter-spacing: -.02em;
  color: var(--accent);
}
.hero__city { color: #fff; font-weight: 700; }

.hero__lead {
  max-width: 46ch;
  margin: 0;
  color: rgba(255, 255, 255, .82);
  font-size: clamp(1rem, .95rem + .4vw, 1.2rem);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .75rem;
  margin-top: .75rem;
}

/* --- Секции ------------------------------------------------------------- */

.section { padding-block: var(--section-y); }
.section--alt { background: var(--bg-alt); border-block: 1px solid var(--line); }
.section--registry { background: var(--bg-alt); border-bottom: 1px solid var(--line); padding-block: clamp(2rem, 4vw, 3rem); }

.section__title {
  margin-bottom: .75rem;
  font-size: clamp(1.6rem, 1.1rem + 2.2vw, 2.5rem);
  font-weight: 700;
  text-align: center;
}

.section__note {
  max-width: 62ch;
  margin: 0 auto clamp(1.75rem, 4vw, 3rem);
  text-align: center;
  color: var(--muted);
  font-size: .95rem;
}
.section__note a { color: var(--focus); }

.section__subtitle {
  margin: clamp(2.5rem, 6vw, 4rem) 0 1.5rem;
  font-size: clamp(1.25rem, 1rem + 1.2vw, 1.75rem);
  font-weight: 700;
  text-align: center;
}
.section__subtitle em { font-style: italic; text-decoration: underline; text-underline-offset: .18em; }

/* --- Таблица «Стоимость услуг» ------------------------------------------ */

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.prices {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg);
  font-size: .95rem;
}
.prices th,
.prices td {
  padding: .85rem .9rem;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.prices thead th {
  background: var(--dark);
  color: #fff;
  font-weight: 600;
  border-color: var(--dark);
}
.prices tbody tr:nth-child(even) { background: var(--bg-alt); }
.prices__sum {
  text-align: right;
  font-weight: 700;
  color: var(--ink);
}
.prices tbody .prices__sum { white-space: nowrap; width: 1%; }
.prices thead .prices__sum { color: #fff; }

/* --- Карточки категорий (повторный ТО) ---------------------------------- */

.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr));
  gap: var(--gap);
}

.cat {
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.cat__head {
  position: relative;
  padding: .9rem 1rem;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--line);
}
.cat__head::after {                 /* единица измерения для колонки цен */
  content: "руб.";
  position: absolute;
  right: 1rem;
  bottom: .95rem;
  font-size: .75rem;
  color: var(--muted);
}
.cat__code {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -.01em;
}
.cat__desc {
  margin: .15rem 0 0;
  padding-right: 3rem;
  font-size: .85rem;
  color: var(--muted);
}

.cat__table {
  width: 100%;
  border-collapse: collapse;
  font-size: .92rem;
}
.cat__table th,
.cat__table td { padding: .55rem 1rem; text-align: left; font-weight: 400; }
.cat__table td { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--ink); font-weight: 600; }
.cat__table tbody tr + tr th,
.cat__table tbody tr + tr td { border-top: 1px solid var(--line); }
.cat__na { color: var(--muted); font-weight: 400; }

.cat__total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin: auto 0 0;             /* прижимает итог к низу карточки при разной высоте */
  padding: .8rem 1rem;
  background: var(--dark);
  color: #fff;
  font-size: .85rem;
}
.cat__total b { font-size: 1rem; white-space: nowrap; }

/* --- Необходимые документы ---------------------------------------------- */

.docs {
  max-width: 44rem;
  margin: 0 auto;
  padding: 0;
  list-style: none;
}
.docs li {
  padding: .95rem 1.25rem;
  margin-bottom: .75rem;
  background: var(--bg);
  border: 1px solid var(--line);
  border-left: 6px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  font-size: 1.05rem;
  color: var(--ink);
  transition: transform .18s ease;
}
.docs li:last-child { margin-bottom: 0; }
.docs li:hover { transform: translateX(3px); }
.docs li:nth-child(1) { border-left-color: var(--red); }
.docs li:nth-child(2) { border-left-color: var(--accent); }
.docs li:nth-child(3) { border-left-color: var(--green); }

/* --- График работы ------------------------------------------------------ */

.schedule {
  max-width: 46rem;
  margin: 0 auto;
  text-align: center;
}
.schedule p { margin-bottom: 1.35rem; }
.schedule__hours { font-size: clamp(1.05rem, 1rem + .5vw, 1.35rem); color: var(--ink); }
.schedule strong { color: var(--ink); }
.schedule a {
  color: var(--ink);
  font-weight: 700;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: .2em;
}
.schedule__note {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .95rem;
}

/* --- Выписки из реестра (QR) -------------------------------------------- */

.qr-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 18rem));
  justify-content: center;
  gap: var(--gap);
  max-width: 52rem;
  margin: 0 auto;
  padding: 0;
  list-style: none;
}

.qr-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .85rem;
  height: 100%;
  margin: 0;
  padding: 1.25rem;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-align: center;
}
.qr-card__img {
  width: 11rem;
  max-width: 100%;
  height: auto;
  image-rendering: pixelated;   /* QR остаётся резким при увеличении */
}
.qr-card__caption { display: flex; flex-direction: column; gap: .2rem; }
.qr-card__org    { font-size: .9rem; color: var(--body); }
.qr-card__record { font-weight: 700; color: var(--ink); }

/* --- Контакты ----------------------------------------------------------- */

.contacts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
  gap: var(--gap);
  align-items: start;
}

.card {
  height: 100%;
  padding: 1.5rem;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card__title {
  margin-bottom: 1.1rem;
  padding-bottom: .7rem;
  border-bottom: 2px solid var(--accent);
  font-size: 1.15rem;
  font-weight: 700;
}
.card p { margin-bottom: 1.1rem; font-size: .95rem; }
.card__label {
  display: block;
  margin-bottom: .15rem;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted);
}
.card a {
  color: var(--ink);
  font-weight: 600;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: .2em;
  word-break: break-word;
}
.card a:hover { color: var(--focus); }

.req {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: .45rem .9rem;
  margin: 0;
  font-size: .92rem;
}
.req dt { color: var(--muted); white-space: nowrap; }
.req dd { margin: 0; color: var(--ink); font-weight: 600; word-break: break-word; }

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

.site-footer {
  padding-block: 1.75rem;
  background: var(--dark);
  color: rgba(255, 255, 255, .6);
  font-size: .875rem;
  text-align: center;
}

/* --- Самые узкие экраны -------------------------------------------------- */

@media (max-width: 30rem) {
  html { scroll-padding-top: 10rem; }   /* на 320px шапка занимает 4 строки */
  .prices th,
  .prices td { padding: .6rem .55rem; font-size: .875rem; }
  .cat__table th,
  .cat__table td { padding: .5rem .75rem; }
  .cat__total { padding-inline: .75rem; }
  .card { padding: 1.15rem; }
  .btn__label { display: none; }
}
