/* ==========================================================================
   «АвтоСкан» — оформление.
   Палитра: графит + медь на светлой подложке. Шрифты: Manrope (заголовки и
   интерфейс), IBM Plex Sans (текст), IBM Plex Mono (VIN и номера заявок).
   Горизонтального переполнения нигде не прячем: overflow-x:hidden запрещён,
   потому что он маскирует реальную болезнь вёрстки и от замеров, и от пользователя.
   ========================================================================== */

:root {
  --ink: #16232a;
  --deep: #0f1c22;
  --paper: #f5f4f2;
  --card: #ffffff;
  --line: #dedad4;
  --muted: #5d6a6b;
  --accent: #b8562b;
  --accent-dark: #963f1c;
  --accent-soft: #f7e8df;
  --ok: #2f6d5b;
  --warn: #9a6a10;
  --radius: 12px;
  --shadow: 0 12px 34px rgba(15, 28, 34, .08);
  --display: "Manrope", "Segoe UI", sans-serif;
  --sans: "IBM Plex Sans", "Manrope", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --pad: 26px;
}

* { box-sizing: border-box }

html { scroll-behavior: smooth }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16.5px;
  line-height: 1.62;
  -webkit-text-size-adjust: 100%;
}

[hidden] { display: none !important }

h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 800;
  line-height: 1.14;
  letter-spacing: -.018em;
  margin: 0 0 14px;
  overflow-wrap: break-word;
}

h1 { font-size: clamp(2rem, 5.2vw, 3.1rem) }
h2 { font-size: clamp(1.5rem, 3.4vw, 2.2rem) }
h3 { font-size: clamp(1.1rem, 2vw, 1.32rem); letter-spacing: -.01em }
p { margin: 0 0 16px }
ul, ol { margin: 0 0 18px; padding-left: 1.15rem }
li { margin-bottom: 7px }
img, svg { max-width: 100% }
a { color: var(--accent-dark) }
code { font-family: var(--mono); font-size: .92em; background: var(--accent-soft); padding: 1px 5px; border-radius: 4px }

.container { width: min(1140px, calc(100% - 36px)); margin-inline: auto }
.narrow { width: min(760px, calc(100% - 36px)); margin-inline: auto }
.muted { color: var(--muted) }
.footnote { font-size: .88rem; color: var(--muted) }
.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: -9999px; z-index: 90; background: var(--card);
  color: var(--ink); padding: 10px 14px; border-radius: 0 0 var(--radius) 0;
}
.skip:focus { left: 0; top: 0 }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px }

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

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 10px 20px; border: 1px solid transparent;
  border-radius: 8px; font-family: var(--display); font-weight: 700; font-size: .96rem;
  text-decoration: none; cursor: pointer; transition: background .18s, border-color .18s, color .18s;
}
.btn-primary { background: var(--accent); color: #fff }
.btn-primary:hover { background: var(--accent-dark) }
.btn-quiet { background: transparent; color: var(--ink); border-color: var(--line) }
.btn-quiet:hover { border-color: var(--accent); color: var(--accent-dark) }
.link-arrow { font-weight: 600; text-decoration: none; border-bottom: 1px solid transparent }
.link-arrow:hover { border-bottom-color: currentColor }
.link-quiet { color: #e9e5df; text-decoration: none; font-size: .92rem; font-weight: 600 }
.link-quiet:hover { color: #fff; text-decoration: underline }

/* -------------------------------------------------------------- шапка сайта */

.topbar {
  position: sticky; top: 0; z-index: 60;
  background: var(--deep); color: #f2efe9; border-bottom: 1px solid rgba(255, 255, 255, .1);
}
.menu-row { display: flex; align-items: center; gap: 22px; min-height: 68px }
.brand {
  display: inline-flex; align-items: center; gap: 9px; text-decoration: none;
  color: inherit; font-family: var(--display); font-weight: 800; font-size: 1.16rem;
  letter-spacing: -.02em; white-space: nowrap;
}
.brand svg { width: 26px; height: 26px; color: var(--accent); flex: 0 0 auto }
.brand:hover { color: #fff }
.menu { display: flex; gap: 20px; margin-left: auto; flex-wrap: wrap }
.menu a { color: #ded9d2; text-decoration: none; font-size: .93rem; font-weight: 500 }
.menu a:hover { color: #fff; text-decoration: underline }
.menu-extra { display: none }
.menu-actions { display: flex; align-items: center; gap: 14px }
.menu-actions .btn { min-height: 42px; padding: 8px 16px }
.menu-toggle {
  display: none; width: 44px; height: 44px; padding: 11px 10px; border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 8px; background: transparent; cursor: pointer;
}
.menu-toggle span { display: block; height: 2px; background: #f2efe9; border-radius: 2px; margin-bottom: 4px }
.menu-toggle span:last-child { margin-bottom: 0 }
.menu-open .menu { display: flex }

/* ------------------------------------------------------------------- герой */

.intro { background: var(--deep); color: #f4f1ec; padding: 74px 0 66px }
.intro-inner { max-width: 880px }
.intro h1 { color: #fff; margin-bottom: 18px }
.intro .lead { font-size: 1.08rem; color: rgba(244, 241, 236, .82); max-width: 66ch }
.intro-facts {
  display: flex; flex-wrap: wrap; gap: 10px 26px; list-style: none; margin: 26px 0 0;
  padding: 0; font-size: .9rem; color: rgba(244, 241, 236, .74);
}
.intro-facts li { margin: 0; padding-left: 15px; position: relative }
.intro-facts li::before {
  content: ""; position: absolute; left: 0; top: .55em; width: 6px; height: 6px;
  border-radius: 50%; background: var(--accent);
}

/* -------------------------------------------------------------------- формы */

.vin-form {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px;
  align-items: start; margin-top: 30px;
}
.vin-field { min-width: 0 }
.vin-input {
  font-family: var(--mono) !important; letter-spacing: .1em; text-transform: uppercase;
}
.field, .vin-input {
  width: 100%; min-height: 48px; padding: 11px 14px; border: 1px solid var(--line);
  border-radius: 8px; background: var(--card); color: var(--ink); font: inherit;
}
textarea.field { min-height: 118px; resize: vertical }
.field:focus, .vin-input:focus { border-color: var(--accent); outline: 2px solid rgba(184, 86, 43, .22); outline-offset: 1px }
.field.invalid { border-color: #a4341f; background: #fdf3f1 }
label { display: block; font-weight: 600; font-size: .95rem; margin-bottom: 14px }
label > .field, label > textarea { margin-top: 6px }
.form-note { font-size: .85rem; color: var(--muted); margin: 6px 0 0; min-height: 20px }
.intro .form-note { color: rgba(244, 241, 236, .62) }
.form-note.is-error, .form-status.is-error { color: #f0b0a2 }
.intro .vin-form .btn { min-height: 48px }
.form-status { font-weight: 600; margin: 12px 0 0; min-height: 22px }
.form-status.is-ok { color: var(--ok) }
.consent-row { display: flex; align-items: flex-start; gap: 10px; font-weight: 400; font-size: .92rem }
.consent-row input { margin-top: 4px; width: 18px; height: 18px; flex: 0 0 auto; accent-color: var(--accent) }
.consent-row span { max-width: 62ch }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px }
.contact-form, .request-form { display: block }

/* ------------------------------------------------------------------ секции */

.section { padding: 74px 0 }
.block-alt { background: #eceae6; border-block: 1px solid var(--line) }
.block-head { max-width: 62ch; margin-bottom: 34px }
.block-head p { color: var(--muted); margin-bottom: 0 }

.page-head { background: var(--deep); color: #f4f1ec; padding: 52px 0 46px }
.page-head h1 { color: #fff }
.page-head .lead { color: rgba(244, 241, 236, .8); font-size: 1.04rem; max-width: 66ch }
.crumbs { font-size: .85rem; color: rgba(244, 241, 236, .62); margin-bottom: 16px }
.crumbs a { color: rgba(244, 241, 236, .82); text-decoration: none }
.crumbs a:hover { text-decoration: underline }

/* --------------------------------------------------- схема и направления */

.scanner { display: grid; grid-template-columns: minmax(0, .82fr) minmax(0, 1.18fr); gap: 30px; align-items: start }
.scan-figure { position: sticky; top: 96px; margin: 0 }
.scan-figure img {
  display: block; width: 100%; height: auto; border-radius: var(--radius);
  box-shadow: var(--shadow); background: #dfe4e2;
}
.scan-figure figcaption { margin-top: 12px; font-size: .9rem; color: var(--muted); max-width: 34ch }

.module-list, .module-grid { display: grid; gap: 14px }
.module-list { grid-template-columns: 1fr }
.module-grid { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)) }
.module-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 22px;
}
.module-card p { margin-bottom: 10px; color: var(--muted) }
.module-card h3 { margin-bottom: 8px }
.package-tag {
  display: inline-block; padding: 4px 10px; border-radius: 999px; background: var(--accent-soft);
  color: var(--accent-dark); font-family: var(--display); font-weight: 700; font-size: .78rem;
}

/* ------------------------------------------------------------------- пакеты */

.tariff-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 18px }
.tariff-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px 24px; display: flex; flex-direction: column; align-items: flex-start;
}
.tariff-card.is-featured { border-color: var(--accent); box-shadow: var(--shadow) }
.tariff-card h3 { margin-bottom: 6px }
.tariff-price { font-family: var(--display); font-weight: 800; font-size: 2.1rem; letter-spacing: -.02em; margin-bottom: 6px }
.tariff-note { color: var(--muted); font-size: .95rem }
.tariff-includes { list-style: none; padding: 0; margin: 0 0 20px; font-size: .93rem; color: var(--muted) }
.tariff-includes li { margin-bottom: 5px; padding-left: 17px; position: relative }
.tariff-includes li::before {
  content: ""; position: absolute; left: 0; top: .5em; width: 8px; height: 4px;
  border-left: 2px solid var(--ok); border-bottom: 2px solid var(--ok); transform: rotate(-45deg) translateY(-2px);
}
.tariff-card .btn { margin-top: auto }

.constructor { margin-top: 44px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px }
.constructor-head { margin-bottom: 18px }
.constructor-head p { color: var(--muted); margin-bottom: 0 }
.constructor-body { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 26px; align-items: start }
.check-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 18px }
.check-row { display: flex; align-items: center; gap: 10px; font-weight: 500; padding: 7px 0; margin: 0 }
.check-row input { width: 19px; height: 19px; accent-color: var(--accent); flex: 0 0 auto; margin: 0 }
.check-row input:disabled + span { color: var(--muted) }
.estimate { background: #f3efe9; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px }
.estimate-label { text-transform: uppercase; letter-spacing: .1em; font-size: .74rem; font-weight: 700; color: var(--muted); margin-bottom: 6px }
.estimate-price { font-family: var(--display); font-weight: 800; font-size: 2.4rem; letter-spacing: -.025em; margin-bottom: 2px }
.estimate-pack { color: var(--muted); margin-bottom: 16px }
.estimate-rules { list-style: none; padding: 0; margin: 0 0 18px; font-size: .9rem; color: var(--muted) }
.estimate-rules li { display: flex; justify-content: space-between; gap: 14px; padding: 5px 0; border-bottom: 1px dashed var(--line); margin: 0 }
.estimate-rules b { color: var(--ink); font-family: var(--display); font-weight: 700; white-space: nowrap }
.estimate .btn { width: 100% }

/* --------------------------------------------------------------------- FAQ */

.faq-list { border-top: 1px solid var(--line) }
.faq-item { border-bottom: 1px solid var(--line); padding: 4px 0 }
.faq-item summary {
  display: flex; align-items: baseline; gap: 14px; cursor: pointer; list-style: none;
  padding: 16px 0; font-family: var(--display); font-weight: 700; font-size: 1.04rem;
}
.faq-item summary::-webkit-details-marker { display: none }
.faq-item summary:hover { color: var(--accent-dark) }
.faq-mark { margin-left: auto; flex: 0 0 auto; width: 14px; height: 14px; position: relative }
.faq-mark::before, .faq-mark::after { content: ""; position: absolute; background: var(--accent) }
.faq-mark::before { inset-inline: 0; top: 50%; height: 2px; transform: translateY(-50%) }
.faq-mark::after { inset-block: 0; left: 50%; width: 2px; transform: translateX(-50%); transition: transform .18s }
.faq-item[open] .faq-mark::after { transform: translateX(-50%) scaleY(0) }
.faq-item p { color: var(--muted); margin: 0 0 16px; max-width: 68ch }
.support-note { margin-top: 22px; padding: 14px 16px; background: var(--accent-soft); border-radius: 8px }

/* ------------------------------------------------------------------ статьи */

.review-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px }
.review-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px }
.review-card p { color: var(--muted) }
.doc-body h2 { margin-top: 40px }
.doc-body h3 { margin-top: 34px }
.doc-body p, .doc-body li { max-width: 70ch }
.callout {
  background: var(--accent-soft); border-left: 4px solid var(--accent);
  border-radius: 0 8px 8px 0; padding: 16px 20px; margin: 28px 0;
}
.callout p { margin-bottom: 0 }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card) }
.matrix { width: 100%; border-collapse: collapse; font-size: .95rem; min-width: 480px }
.matrix caption { text-align: left }
.matrix th, .matrix td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top }
.matrix thead th { font-family: var(--display); font-size: .86rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); background: #f3efe9 }
.matrix tbody th { font-weight: 600 }
.matrix tbody tr:last-child th, .matrix tbody tr:last-child td { border-bottom: 0 }
.matrix td.yes { color: var(--ok); font-weight: 600 }
.matrix td.no { color: var(--muted) }

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

.contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 18px }
.contact-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px }
.contact-big { font-family: var(--display); font-weight: 700; font-size: 1.12rem; word-break: break-word }
.contact-card p:last-child { margin-bottom: 0 }

/* ---------------------------------------------------------- оформление заявки */

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px }
.request-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 26px; align-items: start }
.request-side { display: grid; gap: 18px }
.summary-label { text-transform: uppercase; letter-spacing: .1em; font-size: .74rem; font-weight: 700; color: var(--muted); margin-bottom: 4px }
.summary-pack { font-family: var(--display); font-weight: 800; font-size: 1.2rem; margin-bottom: 2px }
.summary-price { font-family: var(--display); font-weight: 800; font-size: 2rem; letter-spacing: -.02em; margin-bottom: 14px }
.summary-list { font-size: .93rem; color: var(--muted); margin-bottom: 0 }
.request-done { border-color: var(--ok); border-width: 1px }
.done-id { font-size: 1.06rem }
.done-links { display: flex; flex-wrap: wrap; gap: 12px; margin: 22px 0 0 }
.cta-band { background: var(--deep); color: #f4f1ec }
.cta-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 22px }
.cta-inner h2 { color: #fff }
.cta-inner p { color: rgba(244, 241, 236, .78); margin-bottom: 0; max-width: 52ch }

/* ------------------------------------------------------------------ кабинет */

.auth { padding-top: 56px }
.auth-card { max-width: 520px; margin-inline: auto }
.auth-card h1 { font-size: 1.7rem }
.auth-alt { font-size: .92rem; color: var(--muted); margin-bottom: 0 }
.cabinet { padding-top: 52px }
.cabinet-grid { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: 26px; align-items: start }
.cabinet-grid.is-solo { grid-template-columns: minmax(0, 1fr) }
.account { position: sticky; top: 92px }
.account-label { text-transform: uppercase; letter-spacing: .1em; font-size: .74rem; font-weight: 700; color: var(--muted); margin-bottom: 6px }
.account-name { font-family: var(--display); font-weight: 800; font-size: 1.15rem; margin-bottom: 2px; word-break: break-word }
.account-mail { color: var(--muted); font-size: .93rem; word-break: break-all }
.account-count { font-family: var(--mono); font-size: .9rem; color: var(--accent-dark) }
.account-actions { display: grid; gap: 10px; margin-bottom: 16px }
.account-actions .btn { width: 100% }
.apps-list { display: grid; gap: 12px }
.app-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 18px; align-items: center;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px;
  text-decoration: none; color: inherit;
}
.app-row:hover { border-color: var(--accent) }
.app-id { font-family: var(--mono); font-size: .9rem; color: var(--accent-dark) }
.app-vin { font-family: var(--mono); letter-spacing: .06em; font-weight: 600 }
.app-meta { grid-column: 1 / -1; color: var(--muted); font-size: .9rem; display: flex; flex-wrap: wrap; gap: 4px 14px }
.pill {
  display: inline-block; padding: 4px 11px; border-radius: 999px; font-family: var(--display);
  font-weight: 700; font-size: .78rem; background: #eae7e2; color: var(--muted); white-space: nowrap;
}
.pill.is-new { background: var(--accent-soft); color: var(--accent-dark) }
.pill.is-work { background: #e7eef1; color: #235b70 }
.pill.is-done { background: #e3f0e9; color: var(--ok) }
.app-dl { display: grid; grid-template-columns: minmax(110px, auto) minmax(0, 1fr); gap: 8px 18px; margin: 0 0 26px }
.app-dl dt { color: var(--muted); font-size: .9rem }
.app-dl dd { margin: 0; font-weight: 600; word-break: break-word }
.app-modules { color: var(--muted) }
.apps-empty { text-align: flex-start }

/* ---------------------------------------------------------------- 404 и футер */

.nf { text-align: center; padding: 96px 0 }
.nf-code { font-family: var(--display); font-weight: 800; font-size: 4rem; color: var(--accent); margin-bottom: 0; line-height: 1 }
.nf-links { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 26px }

.footbar { background: var(--deep); color: #d9d4cd; padding: 54px 0 26px; font-size: .93rem }
.foot-cols { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1.4fr); gap: 34px; align-items: start }
.foot-about .brand { margin-bottom: 14px }
.foot-about p { max-width: 46ch; color: rgba(217, 212, 205, .82) }
.foot-req { font-size: .86rem; color: rgba(217, 212, 205, .66) }
.foot-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 22px }
.foot-links b { display: block; font-family: var(--display); font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; color: rgba(217, 212, 205, .55); margin-bottom: 10px }
.foot-links a { display: block; color: #d9d4cd; text-decoration: none; margin-bottom: 7px }
.foot-links a:hover { color: #fff; text-decoration: underline }
.foot-line {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px;
  margin-top: 38px; padding-top: 20px; border-top: 1px solid rgba(255, 255, 255, .12);
  font-size: .84rem; color: rgba(217, 212, 205, .62);
}
.foot-line a { color: rgba(217, 212, 205, .82); text-decoration: none }
.foot-line a:hover { color: #fff; text-decoration: underline }

/* ------------------------------------------------------------- cookie-бар */

.storage-note { position: fixed; inset-inline: 0; bottom: 0; z-index: 70; background: var(--deep); color: #e7e3dc; box-shadow: 0 -10px 30px rgba(15, 28, 34, .22) }
.storage-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; padding: 16px 0 }
.storage-inner p { margin: 0; font-size: .9rem; max-width: 72ch; color: rgba(231, 227, 220, .86) }
.storage-inner a { color: #fff }
.storage-inner .btn { margin-left: auto }

/* --------------------------------------------------------------- адаптив */

@media (max-width: 1000px) {
  .scanner, .request-grid, .constructor-body, .cabinet-grid, .foot-cols { grid-template-columns: minmax(0, 1fr) }
  .account { position: static }
  .scan-figure { position: static }
}

@media (max-width: 720px) {
  .menu { display: none; width: 100%; order: 3; flex-direction: column; gap: 12px; padding: 4px 0 16px }
  .menu-open .menu { display: flex }
  .menu-row { flex-wrap: wrap; padding: 12px 0; gap: 14px }
  .menu-toggle { display: block }
  .menu-extra { display: block }
  .intro { padding: 48px 0 44px }
  .section { padding: 52px 0 }
  .vin-form { grid-template-columns: minmax(0, 1fr) }
  .vin-form .btn { width: 100% }
  .form-grid { grid-template-columns: minmax(0, 1fr) }
  .estimate { order: -1 }
}

@media (max-width: 520px) {
  body { font-size: 16px }
  .container, .narrow { width: min(100% - 24px, 1140px) }
  :root { --pad: 14px }
  .menu-actions .link-quiet { display: none }
  .menu-actions .btn { min-height: 40px; padding: 8px 13px; font-size: .88rem }
  .brand { font-size: 1.05rem }
  .card, .constructor, .contact-card, .tariff-card, .module-card { padding: 18px }
  .app-dl { grid-template-columns: minmax(0, 1fr) }
  .app-dl dt { margin-top: 8px }
  .estimate-price { font-size: 2rem }
  .foot-links { grid-template-columns: 1fr 1fr }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto }
  *, *::before, *::after { animation-duration: .001s !important; transition-duration: .001s !important }
}

@media print {
  .topbar, .footbar, .storage-note, .cta-band, .done-links, .btn { display: none !important }
  body { background: #fff; color: #000 }
  .card, .module-card { border-color: #999; box-shadow: none }
}
