/* АвтоЦифры — один CSS на весь сайт. Шрифты: /fonts.css (Inter, Manrope, OFL). */

:root {
  --paper: #f7f5f1;
  --surface: #ffffff;
  --ink: #101828;
  --ink-soft: #344054;
  --muted: #667085;
  --line: #e7e3da;
  --line-soft: #f0ece4;
  --brand: #14213d;
  --brand-2: #1f3a63;
  --accent: #e8590c;
  --accent-soft: #fff1e6;
  --teal: #0f766e;
  --teal-soft: #e6f4f1;
  --radius-lg: 22px;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
  --shadow-md: 0 8px 24px -12px rgba(16, 24, 40, .18), 0 2px 6px rgba(16, 24, 40, .05);
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-display: 'Manrope', 'Inter', system-ui, sans-serif;
  --wrap: 1120px;
  --pad: clamp(16px, 4vw, 32px);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background:
    radial-gradient(1200px 420px at 12% -8%, #ffffff 0%, rgba(255, 255, 255, 0) 62%),
    var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
}

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--pad); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

a { color: var(--brand-2); text-decoration-color: rgba(31, 58, 99, .35); text-underline-offset: 3px; }
a:hover { color: var(--accent); text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

/* ---------- шапка ---------- */
.site-head {
  position: sticky; top: 0; z-index: 40;
  background: rgba(247, 245, 241, .84);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.site-head .wrap {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: clamp(12px, 2vw, 28px);
  min-height: 66px; padding-top: 10px; padding-bottom: 10px;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-display); font-weight: 800; font-size: 1.12rem; letter-spacing: -.02em;
  color: var(--ink); text-decoration: none; white-space: nowrap;
}
.brand::before {
  content: ''; width: 30px; height: 30px; border-radius: 9px; flex: none;
  background: conic-gradient(from 210deg, #14213d 0 42%, #e8590c 42% 58%, #14213d 58% 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .35);
}
.site-nav { display: flex; align-items: center; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.site-nav::-webkit-scrollbar { display: none; }
.site-nav a {
  padding: 8px 12px; border-radius: 999px; font-size: .93rem; font-weight: 500; color: var(--ink-soft);
  text-decoration: none; white-space: nowrap; transition: background .15s ease, color .15s ease;
}
.site-nav a:hover { background: #fff; color: var(--ink); }
.mycar-link {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 15px; border-radius: 999px;
  background: var(--ink); color: #fff; font-size: .9rem; font-weight: 600; text-decoration: none;
  box-shadow: var(--shadow-sm); white-space: nowrap; transition: transform .15s ease, background .15s ease;
}
.mycar-link::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: #52d1a4; box-shadow: 0 0 0 3px rgba(82, 209, 164, .22); }
.mycar-link:hover { background: var(--brand-2); color: #fff; transform: translateY(-1px); }
.search { display: none; }

/* ---------- сетка страницы ---------- */
main.wrap { padding-top: clamp(20px, 3vw, 34px); padding-bottom: clamp(40px, 6vw, 72px); display: grid; grid-template-columns: minmax(0, 1fr); }
.crumbs { font-size: .82rem; color: var(--muted); margin-bottom: 16px; letter-spacing: .01em; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--accent); }
main.wrap > .page { max-width: 760px; }
@media (min-width: 1060px) {
  main.wrap { grid-template-columns: minmax(0, 760px) minmax(280px, 1fr); column-gap: clamp(28px, 4vw, 56px); align-items: start; }
  .crumbs, .page { grid-column: 1; }
  .crumbs { grid-row: 1; }
  .page { grid-row: 2; }
  .mycar { grid-column: 2; grid-row: 1 / span 2; position: sticky; top: 92px; }
}

/* ---------- типографика ---------- */
.page h1, .page h2, .page h3 { font-family: var(--font-display); letter-spacing: -.022em; color: var(--ink); }
.page h1 { font-size: clamp(2.05rem, 4.6vw, 3.05rem); line-height: 1.05; font-weight: 800; margin: 0 0 18px; }
.page h2 { font-size: clamp(1.35rem, 2.4vw, 1.7rem); line-height: 1.16; font-weight: 800; margin: 44px 0 14px; }
.page h3 { font-size: 1.06rem; line-height: 1.32; font-weight: 700; margin: 26px 0 8px; }
.page p { margin: 0 0 16px; color: var(--ink-soft); }
.page > p:first-of-type { font-size: 1.13rem; line-height: 1.55; color: var(--ink-soft); }
.page ul, .page ol { margin: 0 0 18px; padding-left: 1.15em; }
.page li { margin: 0 0 8px; color: var(--ink-soft); }
.page li::marker { color: var(--accent); }
.page code { background: var(--teal-soft); color: var(--teal); padding: 2px 6px; border-radius: 6px; font: .9em/1.4 ui-monospace, 'Cascadia Code', Consolas, monospace; }
.page strong { color: var(--ink); font-weight: 600; }

/* ---------- таблицы ---------- */
.table-wrap { margin: 0 0 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: auto; box-shadow: var(--shadow-sm); }
table { border-collapse: collapse; width: 100%; font-size: .95rem; font-variant-numeric: tabular-nums; }
th, td { padding: 12px 16px; text-align: left; white-space: nowrap; border-bottom: 1px solid var(--line-soft); }
thead th { position: sticky; top: 0; z-index: 1; background: #fbfaf7; font-size: .78rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
tbody tr:nth-child(even) { background: #fcfbf9; }
tbody tr:hover { background: #fff7ee; }
tbody tr:last-child td { border-bottom: 0; }
td:first-child, th:first-child { font-weight: 500; color: var(--ink); }

/* ---------- плитки ---------- */
.tiles { display: grid; gap: 14px; margin: 26px 0 6px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.tile {
  position: relative; display: flex; flex-direction: column; gap: 6px; padding: 20px 20px 22px;
  border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line);
  text-decoration: none; color: var(--ink); box-shadow: var(--shadow-sm);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.tile strong { font-family: var(--font-display); font-size: 1.06rem; font-weight: 800; letter-spacing: -.01em; }
.tile span { color: var(--muted); font-size: .92rem; line-height: 1.45; }
.tile::after { content: '→'; position: absolute; right: 18px; bottom: 16px; color: var(--line); font-size: 1.1rem; transition: color .16s ease, transform .16s ease; }
.tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: #d9d3c7; color: var(--ink); }
.tile:hover::after { color: var(--accent); transform: translateX(3px); }
.tile:nth-child(1) { background: linear-gradient(180deg, #fff 0%, #fff 60%, #fff6ec 100%); }
.tile:nth-child(2) { background: linear-gradient(180deg, #fff 0%, #fff 60%, #eef4fb 100%); }
.tile:nth-child(3) { background: linear-gradient(180deg, #fff 0%, #fff 60%, #e9f6f2 100%); }
.tile:nth-child(4) { background: linear-gradient(180deg, #fff 0%, #fff 60%, #f3f0fb 100%); }

/* ---------- калькулятор ---------- */
.calc {
  margin: 26px 0 8px; padding: clamp(16px, 2.4vw, 24px);
  background: linear-gradient(180deg, #ffffff 0%, #fbfaf7 100%);
  border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-md);
}
.calc__fields { display: grid; grid-template-columns: minmax(120px, auto) minmax(0, 1fr); gap: 10px 14px; align-items: center; margin-bottom: 12px; }
.calc__label { font-size: .9rem; color: var(--muted); font-weight: 500; }
.calc__input {
  min-height: 46px; padding: 10px 14px; font: inherit; font-variant-numeric: tabular-nums;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; color: var(--ink);
  max-width: 340px; transition: border-color .15s ease, box-shadow .15s ease;
}
.calc__input:hover { border-color: #d6d0c4; }
.calc__input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(232, 89, 12, .14); outline: none; }
.calc__hint { margin: 0 0 14px; font-size: .84rem; color: var(--muted); }
.calc__table { width: 100%; margin: 0 0 12px; font-size: .95rem; }
.calc__table th, .calc__table td { white-space: normal; padding: 10px 12px; }
.calc__table tbody th { font-weight: 500; color: var(--ink-soft); }
.calc__table tbody td { font-variant-numeric: tabular-nums; color: var(--ink); }
.calc__table tbody td:first-of-type { font-family: var(--font-display); font-weight: 800; font-size: 1.12rem; }
.calc__note { margin: 0; font-size: .84rem; color: var(--muted); }

/* ---------- гараж ---------- */
.garage { margin: 24px 0; padding: clamp(16px, 2.4vw, 24px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.garage__label { display: block; font-weight: 600; margin-bottom: 8px; font-size: .92rem; color: var(--muted); }
.garage__select { width: 100%; max-width: 420px; min-height: 46px; padding: 10px 12px; font: inherit; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; color: var(--ink); }
.garage__out { margin: 16px 0 10px; color: var(--ink-soft); }
.garage__facts { display: grid; grid-template-columns: minmax(120px, auto) 1fr; gap: 8px 18px; margin: 0 0 12px; }
.garage__facts dt { color: var(--muted); font-size: .92rem; }
.garage__facts dd { margin: 0; font-family: var(--font-display); font-weight: 800; font-variant-numeric: tabular-nums; }
.garage__link { font-size: .93rem; }
.garage__reset { min-height: 40px; padding: 8px 14px; font: inherit; font-size: .9rem; cursor: pointer; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--ink-soft); }
.garage__reset:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- «всё про эту машину» ---------- */
.mycar { margin: 28px 0 0; padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.mycar__title { font-family: var(--font-display); font-size: 1rem; font-weight: 800; letter-spacing: -.01em; margin: 0 0 14px; line-height: 1.3; }
.mycar__facts { list-style: none; margin: 0 0 14px; padding: 0; }
.mycar__facts li { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--line); }
.mycar__facts li:last-child { border-bottom: 0; }
.mycar__facts span { color: var(--muted); font-size: .88rem; }
.mycar__facts b { font-family: var(--font-display); font-weight: 800; font-variant-numeric: tabular-nums; }
.mycar__links { margin: 0 0 10px; font-size: .9rem; line-height: 1.9; }
.mycar__source { margin: 0; font-size: .78rem; color: var(--muted); line-height: 1.5; }

/* ---------- подвал ---------- */
.site-foot { border-top: 1px solid var(--line); background: #fbfaf7; padding: 32px 0 40px; font-size: .88rem; color: var(--muted); }
.site-foot p { margin: 0 0 10px; max-width: 68ch; }
.site-foot strong { color: var(--ink); font-family: var(--font-display); }
.site-foot a { color: var(--ink-soft); text-decoration: none; }
.site-foot a:hover { color: var(--accent); }
.muted { color: var(--muted); }

/* ---------- адаптив ---------- */
@media (max-width: 900px) {
  .site-head .wrap { grid-template-columns: auto 1fr; row-gap: 8px; }
  .site-nav { order: 3; grid-column: 1 / -1; margin: 0 calc(-1 * var(--pad)); padding: 4px var(--pad) 2px; }
  .mycar-link { justify-self: end; }
}
@media (max-width: 620px) {
  body { font-size: 16px; }
  .page h1 { font-size: clamp(1.85rem, 8vw, 2.4rem); }
  .calc__fields, .garage__facts { grid-template-columns: 1fr; }
  .calc__input, .garage__select { max-width: none; }
  th, td { padding: 10px 12px; }
  .mycar { margin-top: 24px; }
}

/* ---------- печать ---------- */
@media print {
  .site-head, .site-foot, .crumbs, .mycar-link, .site-nav, .garage__reset { display: none !important; }
  body { background: #fff; font-size: 11.5pt; }
  .wrap { max-width: none; padding: 0; }
  main.wrap { display: block; }
  .calc, .mycar, .table-wrap { box-shadow: none; border-color: #ccc; }
  a { color: #000; text-decoration: none; }
  .page h2 { page-break-after: avoid; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
/* ---------- главная: крупнее и шире ---------- */
body.page-index main.wrap > .page { max-width: 900px; }
body.page-index .page h1 { font-size: clamp(2.4rem, 5.4vw, 3.6rem); letter-spacing: -.03em; }
body.page-index .page > p:first-of-type { font-size: clamp(1.05rem, 1.5vw, 1.2rem); max-width: 62ch; }
body.page-index .page h2 { margin-top: 52px; }
body.page-index .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 700px) { body.page-index .tiles { grid-template-columns: 1fr; } }

.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 26px 0 4px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 12px 22px; border-radius: 999px; font-size: .97rem; font-weight: 600;
  text-decoration: none; border: 1px solid var(--line); background: #fff; color: var(--ink);
  box-shadow: var(--shadow-sm); transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); color: var(--ink); }
.btn--primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn--primary:hover { background: #cf4d08; border-color: #cf4d08; color: #fff; }

.stats { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); margin: 22px 0 4px; }
.stat { padding: 18px 20px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.stat b { display: block; font-family: var(--font-display); font-size: clamp(1.7rem, 3vw, 2.1rem); font-weight: 800; letter-spacing: -.03em; color: var(--accent); line-height: 1.1; margin-bottom: 4px; }
.stat span { color: var(--muted); font-size: .88rem; line-height: 1.45; }

/* главная — на всю ширину контейнера, заголовок ограничен читаемой строкой */
body.page-index main.wrap > .page { max-width: none; }
body.page-index .page h1 { max-width: 880px; }
body.page-index .page > p:first-of-type { max-width: 70ch; }
body.page-index .tiles { margin-top: 18px; }

/* значения в карточке машины — в одну строку */
.mycar__facts b { white-space: nowrap; }

/* защита от горизонтального переполнения на узких экранах */
html, body { max-width: 100%; overflow-x: hidden; }
.site-head .wrap, main.wrap, .page, .table-wrap, .tiles, .stats, .calc, .mycar, .garage { min-width: 0; max-width: 100%; }
.site-nav { min-width: 0; }
table { min-width: 0; }
