/* ПДД Россия 2026 — дизайн-система лендинга.
   Токены 1:1 из приложения (lib/core/constants/app_colors.dart, app_dimensions.dart). */

:root {
  --accent: #0574F8;
  --accent-surface: rgba(5, 116, 248, .1);
  --light-accent: #E8F2FE;
  --text: #121212;
  --muted: #A1A6B7;
  --bg: #F8F8FA;
  --card: #FFFFFF;
  --green: #34A853;
  --green-light: #E6F7DE;
  --red: #EA4335;
  --red-light: #FFE6E6;
  --gold: #FFA53C;
  --gray: #EFF0F4;
  --divider: #E8E8E8;
  --radius-card: 16px;
  --radius-btn: 12px;
  --radius-s: 8px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* ---------- Шапка ---------- */
.site-header {
  background: var(--card);
  border-bottom: 1px solid var(--divider);
  position: sticky; top: 0; z-index: 50;
}
.site-header .container {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.logo {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 17px; color: var(--text);
}
.logo:hover { text-decoration: none; }
.logo img { width: 32px; height: 32px; border-radius: 8px; }
.site-nav { display: flex; align-items: center; gap: 20px; }
.site-nav a { color: var(--text); font-size: 15px; font-weight: 500; }
.site-nav a.nav-cta {
  background: var(--accent); color: #fff;
  padding: 9px 16px; border-radius: var(--radius-btn);
}
.site-nav a.nav-cta:hover { text-decoration: none; opacity: .9; }

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  border-radius: var(--radius-btn);
  padding: 13px 22px;
  font-size: 16px; font-weight: 600;
  transition: opacity .15s ease, transform .15s ease;
}
.btn:hover { text-decoration: none; opacity: .9; transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-store {
  background: var(--text); color: #fff;
  padding: 10px 18px; text-align: left;
}
.btn-store svg { width: 26px; height: 26px; flex: none; }
.btn-store small, .btn-web small { display: block; font-size: 11px; font-weight: 400; opacity: .8; line-height: 1.2; }
.btn-store span, .btn-web span { display: block; font-size: 16px; font-weight: 600; line-height: 1.25; }
/* Единый стиль со сторами: та же чёрная кнопка, только иконка-глобус вместо магазина. */
.btn-web {
  background: var(--text); color: #fff;
  padding: 10px 18px; text-align: left;
}
.btn-web svg { width: 26px; height: 26px; flex: none; }

/* ---------- Hero ---------- */
.hero { padding: 64px 0 72px; overflow: hidden; }
.hero .container {
  display: grid; grid-template-columns: 1.15fr .85fr;
  gap: 48px; align-items: center;
}
.hero h1 { font-size: 44px; line-height: 1.15; letter-spacing: -.5px; margin-bottom: 16px; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero .subtitle { font-size: 19px; color: #5c6270; max-width: 520px; margin-bottom: 28px; }
.hero-badges { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 18px; }
.hero-note { font-size: 14px; color: var(--muted); }

/* ---------- Мокап телефона (тонкая минималистичная рамка вокруг реального скриншота) ---------- */
.phone {
  width: 270px; margin: 0 auto;
  background: var(--text);
  border-radius: 40px;
  padding: 8px;
  box-shadow: 0 20px 45px rgba(18, 18, 18, .16), 0 2px 10px rgba(18, 18, 18, .08);
}
.phone-screen { position: relative; background: #000; border-radius: 33px; padding-top: 26px; overflow: hidden; }
.phone-shot { display: block; width: 100%; height: auto; }
.phone-notch {
  position: absolute; top: 10px; left: 50%; transform: translateX(-50%);
  width: 60px; height: 15px; background: var(--text); border-radius: 10px; z-index: 2;
}
.phone-home {
  position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%);
  width: 84px; height: 4px; background: rgba(255, 255, 255, .5); border-radius: 3px; z-index: 2;
}

/* ---------- Скриншоты приложения (галерея) ---------- */
.shot-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px;
  max-width: 920px; margin: 0 auto;
}
.shot-card { text-align: center; }
.shot-card img {
  width: 100%; height: auto; border-radius: 20px;
  border: 1px solid var(--divider);
  box-shadow: 0 12px 30px rgba(18, 18, 18, .08);
  margin-bottom: 12px;
}
.shot-card span { font-size: 14px; color: #5c6270; font-weight: 500; }
@media (max-width: 900px) { .shot-grid { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Секции ---------- */
.section { padding: 72px 0; }
section[id] { scroll-margin-top: 76px; }
.section.alt { background: var(--card); border-top: 1px solid var(--divider); border-bottom: 1px solid var(--divider); }
.section-title { font-size: 32px; letter-spacing: -.4px; text-align: center; margin-bottom: 12px; }
.section-lead { font-size: 17px; color: #5c6270; text-align: center; max-width: 640px; margin: 0 auto 44px; }

/* ---------- Карточки фич ---------- */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.card {
  background: var(--card); border-radius: var(--radius-card);
  padding: 26px 24px;
  border: 1px solid var(--divider);
}
.section.alt .card { background: var(--bg); }
.card-icon {
  width: 48px; height: 48px; border-radius: 14px;
  background: var(--accent-surface);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px; color: var(--accent);
}
.card-icon svg { width: 24px; height: 24px; }
.card-icon.green { background: var(--green-light); color: var(--green); }
.card-icon.gold { background: #FFF1E6; color: var(--gold); }
.card-icon.red { background: var(--red-light); color: var(--red); }
.card h3 { font-size: 18px; margin-bottom: 8px; }
.card p { font-size: 15px; color: #5c6270; }

/* ---------- Экзамен: факты ---------- */
.exam-facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 36px; }
.fact {
  background: var(--card); border: 1px solid var(--divider);
  border-radius: var(--radius-card); padding: 22px; text-align: center;
}
.fact b { display: block; font-size: 34px; color: var(--accent); letter-spacing: -.5px; }
.fact span { font-size: 14px; color: #5c6270; }

/* ---------- FAQ ---------- */
.faq { max-width: 720px; margin: 0 auto; }
.faq details {
  background: var(--card); border: 1px solid var(--divider);
  border-radius: var(--radius-card);
  padding: 18px 22px; margin-bottom: 12px;
}
.faq summary {
  font-size: 16.5px; font-weight: 600; cursor: pointer; list-style: none;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--accent); font-size: 22px; font-weight: 400; flex: none; }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin-top: 10px; font-size: 15px; color: #5c6270; }
.faq details a { font-weight: 500; }

/* ---------- CTA-полоса ---------- */
.cta-box {
  background: var(--accent); border-radius: 24px;
  padding: 48px 32px; text-align: center; color: #fff;
}
.cta-box h2 { font-size: 30px; margin-bottom: 10px; letter-spacing: -.4px; }
.cta-box p { font-size: 17px; opacity: .9; margin-bottom: 26px; }
.cta-box .hero-badges { justify-content: center; margin-bottom: 0; }
/* Внутри синего блока — все три кнопки в едином белом стиле. */
.cta-box .btn-store, .cta-box .btn-web { background: #fff; color: var(--text); }

/* ---------- Футер ---------- */
.site-footer {
  background: var(--card); border-top: 1px solid var(--divider);
  padding: 36px 0; margin-top: 0;
}
.site-footer .container {
  display: flex; flex-wrap: wrap; gap: 16px 32px;
  align-items: center; justify-content: space-between;
}
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.site-footer a { color: #5c6270; font-size: 14px; }
.site-footer .copy { color: var(--muted); font-size: 13px; }

/* ---------- Блог: сетка карточек (общая для /blog/ и блока «Из блога» на главной) ---------- */
.post-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.post-card {
  display: block; background: var(--card);
  border: 1px solid var(--divider); border-radius: var(--radius-card);
  padding: 20px 22px; color: var(--text);
}
.post-card:hover { text-decoration: none; border-color: var(--accent); }
.post-card time { font-size: 13.5px; color: var(--muted); }
.post-card h2, .post-card h3 { font-size: 18px; margin: 6px 0 0; letter-spacing: -.2px; }
.post-card-cover {
  width: 100%; height: 140px; object-fit: cover; object-position: center;
  border-radius: var(--radius-s);
  border: 1px solid var(--divider);
  margin-bottom: 16px;
}
.blog-all-link { text-align: center; margin-top: 28px; }
@media (max-width: 900px) { .post-grid { grid-template-columns: 1fr; } }
@media (max-width: 600px) { .post-card-cover { height: 120px; } }

/* ---------- Обложка статьи (полноразмерная, в теле самой статьи) ---------- */
.post-cover {
  width: 100%; height: auto;
  border-radius: var(--radius-card);
  border: 1px solid var(--divider);
  margin: 4px 0 28px;
}

/* ---------- Статья ---------- */
.prose { max-width: 720px; margin: 0 auto; }
.prose header { margin-bottom: 32px; }
.prose h1 { font-size: 36px; line-height: 1.2; letter-spacing: -.5px; margin-bottom: 12px; }
.prose .post-meta { font-size: 14px; color: var(--muted); }
.prose h2 { font-size: 26px; letter-spacing: -.3px; margin: 40px 0 14px; }
.prose h3 { font-size: 20px; margin: 28px 0 10px; }
.prose p, .prose li { font-size: 16.5px; color: #33363f; }
.prose p { margin-bottom: 16px; }
.prose ul, .prose ol { margin: 0 0 16px 22px; }
.prose li { margin-bottom: 8px; }
.prose strong { color: var(--text); }
.prose img {
  width: 100%; height: auto;
  border-radius: var(--radius-card);
  border: 1px solid var(--divider);
  margin: 8px 0 24px;
}
.prose .note {
  background: var(--light-accent); border-radius: var(--radius-card);
  padding: 18px 22px; margin: 24px 0; font-size: 15.5px;
}
.prose .note a { font-weight: 600; }
.prose table { width: 100%; border-collapse: collapse; margin: 20px 0; background: var(--card); border-radius: var(--radius-s); overflow: hidden; font-size: 15px; }
.prose th, .prose td { border: 1px solid var(--divider); padding: 10px 14px; text-align: left; }
.prose th { background: var(--gray); font-size: 14px; }
.breadcrumbs { font-size: 14px; color: var(--muted); margin-bottom: 20px; }
.breadcrumbs a { color: var(--muted); }

/* ---------- Словарь терминов ---------- */
.glossary-nav {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin: 24px 0 40px;
}
.glossary-nav a {
  background: var(--card); border: 1px solid var(--divider);
  border-radius: 20px; padding: 8px 16px;
  font-size: 14px; font-weight: 500; color: var(--text);
}
.glossary-nav a:hover { text-decoration: none; border-color: var(--accent); color: var(--accent); }
.term-list {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px;
  margin-bottom: 44px;
}
.term-card {
  background: var(--card); border: 1px solid var(--divider);
  border-radius: var(--radius-card); padding: 20px 22px;
  scroll-margin-top: 90px;
}
.term-card h3 { font-size: 17.5px; margin-bottom: 8px; letter-spacing: -.1px; }
.term-card p { font-size: 15px; color: #33363f; line-height: 1.5; }
.term-card .see-also { font-size: 13px; color: var(--muted); margin-top: 10px; }
.term-card .read-more { font-size: 13.5px; margin-top: 8px; font-weight: 500; }
@media (max-width: 700px) { .term-list { grid-template-columns: 1fr; } }

/* ---------- Мини-экзамен (/proverit-znaniya/) ---------- */
.quiz-card {
  background: var(--card); border: 1px solid var(--divider);
  border-radius: var(--radius-card); padding: 32px;
  max-width: 640px; margin: 0 auto;
}
.quiz-progress { font-size: 14px; color: var(--muted); margin-bottom: 12px; font-weight: 500; }
.quiz-progress-bar { height: 6px; background: var(--gray); border-radius: 4px; margin-bottom: 24px; overflow: hidden; }
.quiz-progress-bar > div { height: 100%; background: var(--accent); border-radius: 4px; transition: width .25s ease; }
.quiz-topic { font-size: 13px; color: var(--accent); font-weight: 600; margin-bottom: 8px; }
.quiz-question { font-size: 19px; font-weight: 600; line-height: 1.4; margin-bottom: 20px; }
.quiz-answers { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.quiz-answer {
  text-align: left; width: 100%; background: var(--bg); border: 1.5px solid var(--divider);
  border-radius: var(--radius-s); padding: 14px 16px; font-size: 15.5px; color: var(--text);
  cursor: pointer; transition: border-color .15s ease, background .15s ease;
  font-family: inherit; line-height: 1.4;
}
.quiz-answer:hover:not(:disabled) { border-color: var(--accent); }
.quiz-answer:disabled { cursor: default; }
.quiz-answer.correct { background: var(--green-light); border-color: var(--green); }
.quiz-answer.incorrect { background: var(--red-light); border-color: var(--red); }
.quiz-explain {
  background: var(--light-accent); border-radius: var(--radius-s); padding: 14px 16px;
  font-size: 14.5px; color: #33363f; line-height: 1.55; margin-bottom: 20px;
}
.quiz-next {
  background: var(--accent); color: #fff; border: none; border-radius: var(--radius-btn);
  padding: 12px 24px; font-size: 15.5px; font-weight: 600; cursor: pointer;
  transition: opacity .15s ease;
}
.quiz-next:hover { opacity: .9; }
.quiz-result { text-align: center; }
.quiz-result .score { font-size: 48px; font-weight: 700; color: var(--accent); margin-bottom: 6px; letter-spacing: -1px; }
.quiz-result .tier { font-size: 18px; font-weight: 600; margin-bottom: 14px; }
.quiz-result .weak { font-size: 14.5px; color: #5c6270; margin-bottom: 26px; line-height: 1.65; }
.quiz-result .weak a { font-weight: 500; }
.quiz-result .hero-badges { justify-content: center; margin-bottom: 16px; }
.quiz-restart { font-size: 14px; font-weight: 500; }
@media (max-width: 600px) {
  .quiz-card { padding: 22px 18px; }
  .quiz-result .score { font-size: 40px; }
}

/* ---------- Адаптив ---------- */
@media (max-width: 900px) {
  .hero .container { grid-template-columns: 1fr; gap: 40px; }
  .hero { padding: 44px 0 56px; }
  .hero h1 { font-size: 34px; }
  .cards { grid-template-columns: 1fr 1fr; }
  .exam-facts { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .cards { grid-template-columns: 1fr; }
  .section { padding: 52px 0; }
  .section-title { font-size: 26px; }
  .hero h1 { font-size: 30px; }
  .prose h1 { font-size: 28px; }
  .site-nav a:not(.nav-cta) { display: none; }
  .hero-badges .btn { width: 100%; }
  .cta-box { padding: 36px 20px; }
}
