/* Тема «Четыре ресурса™» для motorchk. Mobile-first. */
@font-face {
  font-family: "Manrope";
  src: url("../fonts/manrope-var.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --c-brand: #7b0323;
  --c-brand-dark: #5e021b;
  --c-header: #8a1232;
  --c-bg: #f6f2ee;
  --c-tint: #efe7e1;
  --c-card: #ffffff;
  --c-text: #333333;
  --c-muted: #6b6461;
  --c-line: #e3d9d3;
  --c-focus: #d4a017;
  --c-ok: #1f6b3a;
  --c-err: #b3261e;
  --font: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --fs-base: 1rem;
  --fs-lead: 1.125rem;
  --fs-h1: clamp(2rem, 1.4rem + 3vw, 3.25rem);
  --fs-h2: clamp(1.6rem, 1.25rem + 1.6vw, 2.4rem);
  --fs-h3: clamp(1.2rem, 1.1rem + .5vw, 1.45rem);
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 10px 30px rgba(68, 20, 30, .08), 0 2px 6px rgba(68, 20, 30, .05);
  --gap: clamp(1rem, .7rem + 1.5vw, 2rem);
  --section-y: clamp(3rem, 2rem + 4vw, 6rem);
  --container: 1200px;
  --header-h: 64px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 1rem); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }
body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--fs-base);
  line-height: 1.6;
  color: var(--c-text);
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--c-brand); text-underline-offset: .18em; }
a:hover { color: var(--c-brand-dark); }
:focus-visible { outline: 3px solid var(--c-focus); outline-offset: 2px; border-radius: 4px; }
main:focus { outline: none; }
h1, h2, h3, h4 { line-height: 1.2; color: #2a1a1e; margin: 0 0 .6em; font-weight: 750; letter-spacing: -.01em; text-wrap: balance; }
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
h4 { font-size: 1.125rem; }
p { margin: 0 0 1em; }

.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 1rem; top: -100px; z-index: 100; background: #fff; color: var(--c-brand); padding: .6rem 1rem; border-radius: 8px; box-shadow: var(--shadow); }
.skip-link:focus { top: 1rem; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 1.25rem; }
.container--narrow { max-width: 860px; }
.container--text { max-width: 900px; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--c-header); color: #fff; box-shadow: 0 2px 12px rgba(0,0,0,.15); }
.site-header__inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: var(--header-h); }
.logo { color: #fff; text-decoration: none; font-weight: 800; font-size: 1.125rem; letter-spacing: .01em; white-space: nowrap; }
.logo:hover { color: #fff; opacity: .9; }
.menu-toggle { display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; margin-right: -.5rem; border: 0; background: transparent; color: #fff; cursor: pointer; border-radius: 10px; }
.menu-toggle__bars, .menu-toggle__bars::before, .menu-toggle__bars::after { display: block; width: 24px; height: 2px; background: currentColor; border-radius: 2px; transition: transform .2s, opacity .2s; position: relative; }
.menu-toggle__bars::before, .menu-toggle__bars::after { content: ""; position: absolute; left: 0; }
.menu-toggle__bars::before { top: -7px; }
.menu-toggle__bars::after { top: 7px; }
.menu-toggle[aria-expanded="true"] .menu-toggle__bars { background: transparent; }
.menu-toggle[aria-expanded="true"] .menu-toggle__bars::before { transform: translateY(7px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-toggle__bars::after { transform: translateY(-7px) rotate(-45deg); }
.site-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--c-header); border-top: 1px solid rgba(255,255,255,.15); padding: .5rem 1.25rem 1.25rem; box-shadow: 0 12px 24px rgba(0,0,0,.2); }
.nav-open .site-nav { display: block; }
.nav { list-style: none; margin: 0; padding: 0; }
.nav__link { display: block; color: #fff; text-decoration: none; padding: .8rem .25rem; font-size: 1.0625rem; font-weight: 600; border-bottom: 1px solid rgba(255,255,255,.12); }
.nav__link:hover, .nav__link[aria-current="page"] { color: #fff; text-decoration: underline; }

@media (min-width: 960px) {
  .menu-toggle { display: none; }
  .site-nav { display: block; position: static; padding: 0; background: none; border: 0; box-shadow: none; }
  .nav { display: flex; gap: .25rem; }
  .nav__link { border: 0; padding: .5rem .85rem; border-radius: 999px; font-size: 1rem; }
  .nav__link:hover, .nav__link[aria-current="page"] { background: rgba(255,255,255,.14); text-decoration: none; }
}

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 48px; padding: .75rem 1.5rem; border-radius: 999px; border: 2px solid var(--c-brand); background: var(--c-brand); color: #fff; font: inherit; font-weight: 700; line-height: 1.2; text-decoration: none; text-align: center; cursor: pointer; transition: background .2s, color .2s, transform .1s; }
.btn:hover { background: var(--c-brand-dark); border-color: var(--c-brand-dark); color: #fff; }
.btn:active { transform: translateY(1px); }
.btn--ghost, .actions .btn + .btn { background: transparent; color: var(--c-brand); }
.btn--ghost:hover, .actions .btn + .btn:hover { background: var(--c-brand); color: #fff; }
.btn--wide { width: 100%; }
.actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; }
.section-actions { margin-top: 2rem; display: flex; justify-content: center; }
.section-actions .actions { margin: 0; }

/* Sections */
.section { padding: var(--section-y) 0; }
.section--compact { padding-bottom: 1rem; }
.section--tint { background: var(--c-tint); }
.card { background: var(--c-card); border-radius: var(--radius); box-shadow: var(--shadow); }
.card--pad { padding: clamp(1.25rem, .8rem + 2vw, 2.5rem); }
.prose > :last-child { margin-bottom: 0; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1em; }
.prose li { margin-bottom: .4em; }
.prose blockquote { margin: 1.25rem 0; padding: 1rem 1.25rem; border-left: 4px solid var(--c-brand); background: #faf6f3; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.prose blockquote p:last-child { margin-bottom: 0; }
.section-intro { max-width: 100%; margin-bottom: 2rem; font-size: var(--fs-lead); }

/* Hero */
.hero { background: linear-gradient(180deg, #fff 0%, var(--c-bg) 100%); padding: clamp(2rem, 1rem + 4vw, 5rem) 0; }
.hero__grid { display: grid; gap: 2rem; align-items: center; }
.prose--hero h1 { color: var(--c-brand); }
.prose--hero p { font-size: var(--fs-lead); }
.hero__img { width: 100%; border-radius: var(--radius); box-shadow: var(--shadow); aspect-ratio: 3 / 2; object-fit: cover; }
@media (min-width: 960px) { .hero__grid { grid-template-columns: 1.05fr 1fr; gap: 3rem; } }

/* Hero: фото крупнее и как частичная подложка под текст hero и цитату (desktop) */
@media (min-width: 960px) {
  body { overflow-x: clip; }
  .hero { position: relative; }
  .hero__grid { position: relative; }
  .hero__text { position: relative; z-index: 1; }
  /* Фото вынимаем из потока: тянется от верха hero до цитаты, левый и правый края растворяются */
  .hero__media { position: absolute; inset: -1.5rem -2rem -10rem 40%; margin: 0; }
  .hero__img {
    height: 100%;
    width: 100%;
    aspect-ratio: auto;
    box-shadow: none;
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 22%, #000 93%, transparent 100%), linear-gradient(180deg, #000 55%, transparent 95%);
    -webkit-mask-composite: source-in;
    mask-image: linear-gradient(90deg, transparent 0, #000 22%, #000 93%, transparent 100%), linear-gradient(180deg, #000 55%, transparent 95%);
    mask-composite: intersect;
  }
  .section--quote { margin-top: -2rem; position: relative; z-index: 1; }
  /* Цитата прижата к правому краю — под фото */
  .quote { margin-left: auto; text-align: right; }
}

/* Quote */
.section--quote { padding: clamp(1rem, .6rem + 1vw, 1.75rem) 0 clamp(1.5rem, 1rem + 2vw, 3rem); }
.quote { position: relative; max-width: 500px; padding: 1.25rem 0 .25rem; }
.quote blockquote { margin: 0; padding: 0; border: 0; background: none; font-size: clamp(.9rem, .87rem + .1vw, .97rem); line-height: 1.5; font-weight: 500; color: #2a1a1e; position: relative; }
.quote blockquote p { margin-bottom: .5em; }
.quote > p { margin-top: 1rem; color: var(--c-muted); font-weight: 600; font-size: .8rem; }

/* About */
.about { display: grid; gap: var(--gap); align-items: start; }
.about__img { width: 100%; border-radius: var(--radius); box-shadow: var(--shadow); aspect-ratio: 3 / 4; object-fit: cover; max-height: 640px; }
.about__text h3 { margin-top: 1.5rem; color: var(--c-brand); font-size: 1.15rem; text-transform: uppercase; letter-spacing: .04em; }
/* На десктопе фото растягивается по высоте карточки с текстом — блоки ровняются */
@media (min-width: 960px) {
  .about { grid-template-columns: 5fr 7fr; align-items: stretch; }
  .about__media { position: static; }
  .about__img { height: 100%; aspect-ratio: auto; max-height: none; object-position: 50% 12%; }
}

/* Cards */
.cards { display: grid; gap: var(--gap); }
.cards .card { display: flex; flex-direction: column; overflow: hidden; }
.card__body { padding: clamp(1.25rem, 1rem + 1vw, 2rem); display: flex; flex-direction: column; flex: 1; }
.card__body .actions { margin-top: auto; padding-top: 1rem; }
.card__title { color: var(--c-brand); }
.card__img { width: 100%; aspect-ratio: 5 / 4; object-fit: cover; object-position: 50% 15%; }
.cards--four .card { border-top: 5px solid var(--c-brand); }
@media (min-width: 640px) { .cards--four, .cards--two { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .cards--four { grid-template-columns: repeat(4, 1fr); } .cards--three { grid-template-columns: repeat(3, 1fr); } }

/* CTA */
.section--cta { background: var(--c-brand); color: #fff; text-align: center; }
.prose--invert, .prose--invert h2 { color: #fff; }
.prose--invert p { font-size: var(--fs-lead); }
.prose--invert .actions { justify-content: center; }
.prose--invert .btn { background: #fff; color: var(--c-brand); border-color: #fff; }
.prose--invert .btn:hover { background: transparent; color: #fff; }

/* Contact / diagnostika */
.contact, .diag { display: grid; gap: var(--gap); align-items: start; }
@media (min-width: 960px) { .contact, .diag { grid-template-columns: 5fr 7fr; } }
.contacts { margin-top: 1.5rem; }
.contacts__label { font-weight: 700; margin-right: .35rem; }
.contacts__row a { font-weight: 600; word-break: break-all; }
.socials { list-style: none; padding: 0; margin: 1rem 0 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.socials__link { display: inline-flex; align-items: center; min-height: 44px; padding: .5rem 1rem; border-radius: 999px; border: 1.5px solid currentColor; text-decoration: none; font-weight: 700; }
.socials__link:hover { background: var(--c-brand); color: #fff; border-color: var(--c-brand); }

/* Forms */
.form-grid { display: grid; gap: 1rem; }
@media (min-width: 640px) { .form-grid { grid-template-columns: 1fr 1fr; } .field--full, .form-grid > .form-msg { grid-column: 1 / -1; } }
.field { display: flex; flex-direction: column; gap: .35rem; }
.field label { font-weight: 600; font-size: 1rem; }
.req { color: var(--c-brand); }
input[type="text"], input[type="email"], input[type="tel"], select, textarea {
  width: 100%; min-height: 48px; padding: .7rem .9rem; font: inherit; font-size: 1rem; color: var(--c-text);
  background: #fff; border: 1.5px solid #cfc3bc; border-radius: var(--radius-sm); appearance: none;
}
select { background-image: linear-gradient(45deg, transparent 50%, var(--c-brand) 50%), linear-gradient(135deg, var(--c-brand) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 2.5rem; }
textarea { min-height: 120px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--c-brand); outline: 3px solid rgba(123, 3, 35, .18); outline-offset: 0; }
.field--check { flex-direction: row; align-items: flex-start; gap: .7rem; margin-bottom: .6rem; }
.field--check input { flex: 0 0 auto; width: 22px; height: 22px; margin: .15rem 0 0; accent-color: var(--c-brand); }
.field--check label { font-weight: 400; font-size: 1rem; flex: 1 1 0; min-width: 0; }
.field--check [data-form-error] { flex-basis: 100%; }
[data-form-error] { color: var(--c-err); font-size: .95rem; margin: .25rem 0 0; flex-basis: 100%; }
.field--check { flex-wrap: wrap; }
.form-msg { padding: .9rem 1rem; border-radius: var(--radius-sm); font-weight: 600; }
.form-msg--error { background: #fdecea; color: var(--c-err); }
.form-msg--success { background: #e7f4ec; color: var(--c-ok); }

/* Materials */
.page-intro { max-width: 820px; font-size: var(--fs-lead); }
.anchors { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; }
.lead { display: grid; gap: var(--gap); align-items: center; margin-bottom: var(--gap); }
.lead__img { width: 100%; max-width: 420px; border-radius: var(--radius); box-shadow: var(--shadow); }
@media (min-width: 960px) { .lead { grid-template-columns: 4fr 8fr; } }
.lead__text .btn { margin-top: 1rem; }
.quiz-wrap { scroll-margin-top: calc(var(--header-h) + 1rem); }

.quiz__progress { margin-bottom: 1.25rem; }
.quiz__step-label { font-weight: 700; color: var(--c-brand); margin-bottom: .5rem; }
.quiz__bar { height: 8px; background: var(--c-tint); border-radius: 999px; overflow: hidden; }
.quiz__bar span { display: block; height: 100%; width: 0; background: var(--c-brand); transition: width .3s; }
.quiz__hint { color: var(--c-muted); }
.quiz__step + .quiz__step { margin-top: 2rem; }
.quiz--js .quiz__step + .quiz__step { margin-top: 0; }
.quiz__step-title { color: var(--c-brand); }
.quiz__subtitle { margin-top: 2rem; }
.question { border: 0; margin: 0 0 1.5rem; padding: 0; min-width: 0; }
.question__title { font-weight: 700; font-size: 1.0625rem; margin-bottom: .75rem; padding: 0; }
.question__num { color: var(--c-brand); }
.options { display: grid; gap: .5rem; }
@media (min-width: 640px) { .options { grid-template-columns: repeat(2, 1fr); } .options--row { grid-template-columns: repeat(3, 1fr); } }
.option { position: relative; display: flex; align-items: center; gap: .65rem; min-height: 48px; padding: .65rem .9rem; border: 1.5px solid var(--c-line); border-radius: var(--radius-sm); background: #fff; cursor: pointer; transition: border-color .15s, background .15s; }
.option:hover { border-color: var(--c-brand); }
.option input { width: 20px; height: 20px; margin: 0; accent-color: var(--c-brand); flex: 0 0 auto; }
.option:has(input:checked) { border-color: var(--c-brand); background: #fbf1f3; font-weight: 600; }
.option:has(input:focus-visible) { outline: 3px solid var(--c-focus); outline-offset: 2px; }
.question [data-form-error] { grid-column: 1 / -1; }
.quiz__nav { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1rem; }
.quiz__nav--final { margin-top: .5rem; }
.quiz__error { color: var(--c-err); font-weight: 600; margin-top: .75rem; }

.scores { display: grid; gap: .75rem; margin-bottom: 1.5rem; }
@media (min-width: 640px) { .scores { grid-template-columns: repeat(2, 1fr); } }
.score { display: grid; grid-template-columns: 1fr auto; gap: .35rem .75rem; align-items: center; padding: 1rem; border-radius: var(--radius-sm); background: var(--c-bg); margin: 0; }
.score__name { font-weight: 700; }
.score__value { font-weight: 800; color: var(--c-brand); }
.score__meter { grid-column: 1 / -1; height: 6px; background: #e8dcd5; border-radius: 999px; overflow: hidden; }
.score__meter span { display: block; height: 100%; width: 0; background: var(--c-brand); }
.score__level { grid-column: 1 / -1; color: var(--c-muted); font-size: .95rem; }
.score--total { grid-column: 1 / -1; background: var(--c-brand); color: #fff; }
.score--total .score__value { color: #fff; }
.result-text { padding: 1.25rem; border-left: 4px solid var(--c-brand); background: #fbf1f3; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; margin-bottom: 1.5rem; }
.result-text:empty { display: none; }
.result-text__title { font-weight: 800; font-size: 1.125rem; margin-bottom: .4rem; }
.result-text p:last-child { margin-bottom: 0; }
.legend { font-size: 1rem; color: var(--c-muted); }
.legend ul { padding-left: 1.2em; }
.hint { color: var(--c-muted); }

.scale { list-style: none; padding: 0; margin: 1.25rem 0; display: grid; gap: .5rem; }
@media (min-width: 640px) { .scale { grid-template-columns: repeat(3, 1fr); } }
.scale__item { padding: .9rem 1rem; border-radius: var(--radius-sm); background: #fff; border: 1.5px solid var(--c-line); }
.scale--static .scale__item { background: rgba(255,255,255,.7); }
.scale__item strong { display: block; color: var(--c-brand); font-size: 1.125rem; }
.scale__item.is-active { border-color: var(--c-brand); background: #fbf1f3; }

.consultant { display: flex; gap: 1rem; align-items: flex-start; margin: 1rem 0; padding: 1rem; background: var(--c-bg); border-radius: var(--radius); }
.consultant__img { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; }
.consultant__name { font-weight: 700; margin-bottom: .35rem; }
.consultant__name span { display: block; font-weight: 400; color: var(--c-muted); font-size: .95rem; }
.consultant__text { margin: 0; }

/* Checklist accordions */
.checklist__group { margin-top: 2.5rem; }
.checklist__group > h2 { font-size: var(--fs-h3); color: var(--c-brand); }
.sign { background: #fff; border-radius: var(--radius-sm); box-shadow: var(--shadow); margin-bottom: .75rem; }
.sign__summary { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 56px; padding: 1rem 1.25rem; cursor: pointer; font-weight: 700; font-size: 1.0625rem; list-style: none; border-radius: var(--radius-sm); }
.sign__summary::-webkit-details-marker { display: none; }
.sign__icon { flex: 0 0 auto; width: 28px; height: 28px; border-radius: 50%; background: var(--c-tint); position: relative; }
.sign__icon::before, .sign__icon::after { content: ""; position: absolute; left: 50%; top: 50%; width: 12px; height: 2px; background: var(--c-brand); transform: translate(-50%, -50%); transition: transform .2s; }
.sign__icon::after { transform: translate(-50%, -50%) rotate(90deg); }
.sign[open] .sign__icon::after { transform: translate(-50%, -50%) rotate(0deg); }
.sign__body { padding: 0 1.25rem 1.25rem; }
.sign__body blockquote { margin: .5rem 0 0; }

/* Legal docs */
.prose--doc h1 { font-size: clamp(1.6rem, 1.3rem + 1.5vw, 2.3rem); color: var(--c-brand); }
.prose--doc h2 { font-size: 1.3rem; margin-top: 2rem; }
.prose--doc h3 { font-size: 1.1rem; margin-top: 1.5rem; }
.prose--doc { overflow-wrap: anywhere; }

/* Footer */
.site-footer { background: #2a1a1e; color: #e9dfdb; padding: 3rem 0 2.5rem; }
.site-footer a { color: #fff; }
.site-footer__grid { display: grid; gap: 2rem; }
@media (min-width: 960px) { .site-footer__grid { grid-template-columns: 4fr 3fr 5fr; } }
.site-footer__logo { font-weight: 800; font-size: 1.25rem; color: #fff; margin-bottom: .5rem; }
.site-footer__copy { color: #bfb1ac; }
.footer-links { list-style: none; padding: 0; margin: 0; display: grid; gap: .6rem; }
.footer-links a { text-decoration: none; }
.footer-links a:hover { text-decoration: underline; }
.contacts--footer .socials__link { color: #fff; }
.contacts--footer .socials__link:hover { background: #fff; color: var(--c-brand); border-color: #fff; }

/* Inline edit (motorchk) */
.editable { outline: 1px dashed rgba(123, 3, 35, .35); outline-offset: 6px; }

/* ---------- 404 ---------- */
.page--404 main { background: linear-gradient(180deg, #fff 0%, var(--c-bg) 100%); }
.nf { padding: clamp(2rem, 1rem + 4vw, 5rem) 0; }
.nf__card { text-align: center; }
.nf__code { margin: 0; font-size: clamp(4.5rem, 3rem + 8vw, 8.5rem); font-weight: 800; line-height: 1; letter-spacing: -.04em; color: var(--c-brand); }
.nf__title { margin: .4em 0 .5em; }
.nf__lead { max-width: 560px; margin: 0 auto 1.75rem; font-size: var(--fs-lead); color: var(--c-muted); }
.nf__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: .75rem; margin: 0; }
.nf__links { list-style: none; margin: 2rem 0 0; padding: 0; display: grid; gap: 1rem; }
.nf__link { display: flex; flex-direction: column; gap: .35rem; height: 100%; padding: 1.25rem 1.4rem; color: var(--c-text); text-decoration: none; border-top: 4px solid var(--c-brand); transition: transform .15s, box-shadow .15s; }
.nf__link:hover, .nf__link:focus-visible { transform: translateY(-2px); box-shadow: 0 14px 34px rgba(68, 20, 30, .14); }
.nf__link-title { font-weight: 750; font-size: var(--fs-h3); color: var(--c-brand); }
.nf__link-text { color: var(--c-muted); font-size: .95rem; }
@media (max-width: 479px) { .nf__actions .btn { width: 100%; } }
@media (min-width: 640px) { .nf__links { grid-template-columns: repeat(2, 1fr); } }
