/* ===== Базовые переменные и сброс ===== */
:root {
  --bg: #eef0f7;
  --surface: #ffffff;
  --surface-alt: #f7f8fc;
  --border: #dde1ec;
  --text: #0f1424;
  --text-muted: #5b6376;
  --text-faint: #8a91a6;

  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --primary-light: #eef2ff;
  --accent: #06b6d4;

  --success: #059669;
  --success-bg: #ecfdf5;
  --success-border: #a7f3d0;
  --warning: #b45309;
  --warning-bg: #fffbeb;
  --warning-border: #fde68a;
  --danger: #dc2626;
  --danger-bg: #fef2f2;
  --danger-border: #fecaca;

  --radius-lg: 22px;
  --radius: 16px;
  --radius-sm: 10px;

  --shadow-sm: 0 1px 3px rgba(15, 23, 42, .07), 0 1px 2px rgba(15, 23, 42, .05);
  --shadow-md: 0 20px 45px -18px rgba(15, 23, 42, .22);
  --shadow-glow: 0 18px 40px -14px rgba(79, 70, 229, .45);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ===== Хедер ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(246, 247, 251, .85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -.01em;
}

.brand__mark {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: var(--shadow-glow);
  flex-shrink: 0;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 28px;
  font-size: 14.5px;
  color: var(--text-muted);
}

.header-nav a:hover { color: var(--text); }

/* ===== Hero ===== */
.hero {
  position: relative;
  padding: 88px 0 72px;
  background:
    radial-gradient(760px 420px at 15% -15%, rgba(79, 70, 229, .14), transparent 65%),
    radial-gradient(620px 360px at 100% 0%, rgba(6, 182, 212, .12), transparent 65%),
    var(--bg);
  border-bottom: 1px solid var(--border);
}

.hero__inner {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 720px;
  margin: 0 auto;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--primary-light);
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 22px;
}

.hero h1 {
  font-size: clamp(32px, 5vw, 48px);
  line-height: 1.15;
  letter-spacing: -.02em;
  margin: 0 0 16px;
  font-weight: 800;
}

.hero h1 span {
  background: linear-gradient(100deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero p.lead {
  font-size: 17px;
  color: var(--text-muted);
  margin: 0 auto 40px;
  max-width: 560px;
}

/* ===== Форма поиска ===== */
.search-card {
  position: relative;
  z-index: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 10px;
  max-width: 620px;
  margin: 0 auto;
}

.search-form {
  display: flex;
  gap: 8px;
  align-items: center;
}

.search-form input[type="text"] {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 17px;
  padding: 16px 18px;
  color: var(--text);
  font-family: var(--font);
  text-transform: uppercase;
  letter-spacing: .02em;
}

.search-form input[type="text"]::placeholder {
  text-transform: none;
  color: var(--text-faint);
  letter-spacing: normal;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: var(--radius-sm);
  padding: 15px 26px;
  font-size: 15px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease, opacity .15s ease;
  white-space: nowrap;
}

.btn:active { transform: scale(.97); }

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  box-shadow: 0 10px 24px -8px rgba(79, 70, 229, .55);
}
.btn-primary:hover { box-shadow: 0 14px 30px -8px rgba(79, 70, 229, .65); }

.btn-secondary {
  background: var(--primary-light);
  color: var(--primary-dark);
}
.btn-secondary:hover { background: #e2e2fd; }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.btn-ghost:hover { border-color: var(--text-faint); color: var(--text); }

.btn:disabled { opacity: .6; cursor: progress; }
.btn-block { width: 100%; }

.hero-hints {
  margin-top: 18px;
  font-size: 13px;
  color: var(--text-faint);
}
.hero-hints code {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1px 7px;
  font-size: 12.5px;
}

/* ===== Секции лендинга ===== */
.section { padding: 72px 0; }
.section-alt { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }

.section-head {
  text-align: center;
  max-width: 560px;
  margin: 0 auto 48px;
}
.section-head h2 {
  font-size: clamp(24px, 3.4vw, 32px);
  letter-spacing: -.01em;
  margin: 0 0 12px;
}
.section-head p { color: var(--text-muted); margin: 0; }

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

.step {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  box-shadow: var(--shadow-sm);
  transition: transform .15s ease, box-shadow .15s ease;
}
.step:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.step-num {
  width: 38px; height: 38px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 16px; margin-bottom: 18px;
  box-shadow: 0 8px 18px -6px rgba(79, 70, 229, .55);
}
.step h3 { font-size: 16.5px; margin: 0 0 6px; }
.step p { font-size: 14px; color: var(--text-muted); margin: 0; }

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}
.feature-pill {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 15px 17px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}
.feature-pill .dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  flex-shrink: 0;
}

/* ===== Флеши ===== */
.flash-wrap { max-width: 620px; margin: 0 auto 20px; position: relative; z-index: 2; }
.flash {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  margin-bottom: 10px;
  border: 1px solid;
}
.flash-error { background: var(--danger-bg); color: var(--danger); border-color: var(--danger-border); }
.flash-success { background: var(--success-bg); color: var(--success); border-color: var(--success-border); }

/* ===== Отчёт ===== */
.report-header {
  display: flex;
  gap: 24px;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.report-header__photo {
  width: 96px; height: 96px;
  border-radius: var(--radius);
  object-fit: cover;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.report-header__photo-placeholder {
  width: 96px; height: 96px;
  border-radius: var(--radius);
  background: var(--primary-light);
  color: var(--primary-dark);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.report-header__title { font-size: 22px; font-weight: 800; letter-spacing: -.01em; margin: 0 0 6px; }
.report-header__meta { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 13.5px; color: var(--text-muted); }
.report-header__meta b { color: var(--text); font-weight: 600; }

.vin-chip {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px 10px;
  letter-spacing: .04em;
  font-size: 13px;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 18px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}

.card__head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.card__icon {
  width: 38px; height: 38px;
  border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  background: var(--primary-light);
  color: var(--primary-dark);
}

.card__title { font-weight: 700; font-size: 15px; }

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  margin-left: auto;
}
.badge-ok { background: var(--success-bg); color: var(--success); }
.badge-warn { background: var(--warning-bg); color: var(--warning); }
.badge-bad { background: var(--danger-bg); color: var(--danger); }
.badge-muted { background: var(--surface-alt); color: var(--text-faint); border: 1px solid var(--border); }

.stat-big {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -.02em;
}
.stat-sub { color: var(--text-muted); font-size: 13.5px; margin-top: 2px; }

.kv-block { display: flex; flex-direction: column; gap: 8px; }
.kv-block--divided { padding-top: 14px; margin-top: 14px; border-top: 1px dashed var(--border); }
.kv-row { display: flex; justify-content: space-between; gap: 14px; font-size: 13.5px; }
.kv-label { color: var(--text-muted); flex-shrink: 0; }
.kv-value { text-align: right; font-weight: 600; word-break: break-word; }

.muted { color: var(--text-faint); font-size: 13.5px; }

.timeline { display: flex; flex-direction: column; gap: 0; }
.timeline-item {
  position: relative;
  padding: 0 0 18px 22px;
  border-left: 2px solid var(--border);
}
.timeline-item:last-child { border-color: transparent; padding-bottom: 0; }
.timeline-item::before {
  content: "";
  position: absolute; left: -6px; top: 2px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--primary);
}
.timeline-item b { display: block; font-size: 13.5px; }
.timeline-item span { font-size: 13px; color: var(--text-muted); }

.photo-strip { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.photo-strip img {
  width: 88px; height: 88px; object-fit: cover;
  border-radius: var(--radius-sm); border: 1px solid var(--border);
  flex-shrink: 0;
}

/* ===== Блок "полный отчёт" ===== */
.full-cta {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: var(--radius-lg);
  padding: 30px;
  color: #fff;
  text-align: center;
  margin: 32px 0;
  box-shadow: var(--shadow-glow);
}
.full-cta h3 { margin: 0 0 8px; font-size: 20px; }
.full-cta p { margin: 0 0 20px; opacity: .85; font-size: 14px; }
.full-cta .btn-primary { background: #fff; color: var(--primary-dark); box-shadow: none; }
.full-cta .btn-primary:hover { background: #f4f4ff; }

.section-divider {
  display: flex; align-items: center; gap: 14px;
  margin: 40px 0 20px;
  color: var(--text-faint);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.section-divider::before, .section-divider::after {
  content: ""; flex: 1; height: 1px; background: var(--border);
}

/* ===== Picker (неоднозначный номер) ===== */
.candidates { display: flex; flex-direction: column; gap: 12px; max-width: 640px; margin: 0 auto; }
.candidate {
  display: flex; align-items: center; gap: 16px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 18px;
  cursor: pointer; transition: border-color .15s, box-shadow .15s;
}
.candidate:hover { border-color: var(--primary); box-shadow: var(--shadow-sm); }
.candidate img { width: 56px; height: 56px; border-radius: var(--radius-sm); object-fit: cover; background: var(--surface-alt); }
.candidate-photo-placeholder { width: 56px; height: 56px; border-radius: var(--radius-sm); background: var(--primary-light); flex-shrink: 0; }
.candidate__title { font-weight: 700; font-size: 15px; }
.candidate__meta { font-size: 13px; color: var(--text-muted); }

/* ===== Footer ===== */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 36px 0;
  color: var(--text-faint);
  font-size: 13px;
}
.site-footer__inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }

/* ===== Спиннер ===== */
.spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Auth (админка) ===== */
.auth-shell {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at top, #eef0fb, var(--bg));
  padding: 24px;
}
.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 40px;
  width: 100%; max-width: 380px;
}
.auth-card h1 { font-size: 20px; margin: 0 0 26px; text-align: center; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--text-muted); }
.field input {
  width: 100%; padding: 12px 14px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 14.5px; font-family: var(--font);
  outline: none; transition: border-color .15s;
}
.field input:focus { border-color: var(--primary); }

/* ===== Админ-дашборд ===== */
.admin-shell { max-width: 1180px; margin: 0 auto; padding: 32px 24px 60px; }
.admin-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 28px; }
.admin-top h1 { font-size: 22px; margin: 0; }

.stat-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}
.stat-tile {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
}
.stat-tile .label { font-size: 12.5px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.stat-tile .value { font-size: 26px; font-weight: 800; margin-top: 6px; letter-spacing: -.02em; }
.stat-tile .hint { font-size: 12.5px; color: var(--text-faint); margin-top: 4px; }

.panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 24px; margin-bottom: 24px;
  overflow-x: auto;
}
.panel h2 { font-size: 16px; margin: 0 0 16px; }

table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: left; color: var(--text-muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 10px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
tr:last-child td { border-bottom: none; }

.status-pill { padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; }
.status-resolved, .status-done { background: var(--success-bg); color: var(--success); }
.status-ambiguous { background: var(--warning-bg); color: var(--warning); }
.status-not_found, .status-error { background: var(--danger-bg); color: var(--danger); }
.status-pending { background: var(--surface-alt); color: var(--text-faint); }

/* ===== 404 / 500 ===== */
.error-shell { min-height: 70vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 40px; }
.error-shell .code { font-size: 72px; font-weight: 800; color: var(--primary); letter-spacing: -.03em; }
.error-shell p { color: var(--text-muted); margin: 10px 0 26px; }

/* ===== Утилиты ===== */
.mt-0 { margin-top: 0; }
.center { text-align: center; }

/* ===== Обложки-градиенты (без внешних картинок) ===== */
.cover-a { background: linear-gradient(135deg, var(--primary), var(--accent)); }
.cover-b { background: linear-gradient(135deg, var(--success), var(--primary)); }
.cover-c { background: linear-gradient(135deg, #f59e0b, var(--primary)); }

/* ===== Блог ===== */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}
.blog-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform .15s ease, box-shadow .15s ease;
  display: flex;
  flex-direction: column;
}
.blog-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.blog-card__cover { height: 120px; }
.blog-card__body { padding: 20px; }
.blog-card__meta { font-size: 12.5px; color: var(--text-faint); margin-bottom: 8px; }
.blog-card__body h3 { font-size: 17px; margin: 0 0 8px; letter-spacing: -.01em; }
.blog-card__body p { font-size: 14px; color: var(--text-muted); margin: 0; }

.pagination {
  display: flex; align-items: center; justify-content: center; gap: 18px;
  margin-top: 36px;
}

.breadcrumbs {
  font-size: 13px; color: var(--text-faint);
  display: flex; gap: 8px; margin-bottom: 20px;
}
.breadcrumbs a:hover { color: var(--primary); }

.blog-post__cover {
  height: 180px;
  border-radius: var(--radius-lg);
  margin-bottom: 28px;
}
.blog-post__title { font-size: clamp(26px, 4vw, 36px); letter-spacing: -.02em; margin: 0 0 10px; }
.blog-post__meta { color: var(--text-faint); font-size: 13.5px; margin-bottom: 32px; }

.blog-post__body { font-size: 16px; line-height: 1.75; }
.blog-post__body h2 { font-size: 22px; margin: 36px 0 14px; letter-spacing: -.01em; }
.blog-post__body h3 { font-size: 18px; margin: 28px 0 12px; }
.blog-post__body p { margin: 0 0 18px; }
.blog-post__body ul, .blog-post__body ol { margin: 0 0 18px; padding-left: 22px; }
.blog-post__body li { margin-bottom: 8px; }
.blog-post__body strong { color: var(--text); }
.blog-post__body blockquote {
  margin: 0 0 18px; padding: 14px 20px;
  border-left: 3px solid var(--primary);
  background: var(--primary-light);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-muted);
}
.blog-post__body code {
  background: var(--surface-alt); border: 1px solid var(--border);
  border-radius: 5px; padding: 1px 6px; font-size: 13.5px;
}

/* ===== FAQ ===== */
.faq { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; }
.faq-item {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px 24px;
  box-shadow: var(--shadow-sm);
}
.faq-item summary {
  cursor: pointer; font-weight: 700; font-size: 15px;
  list-style: none; display: flex; justify-content: space-between; align-items: center;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; font-size: 20px; color: var(--primary); font-weight: 400; }
.faq-item[open] summary::after { content: "−"; }
.faq-item p { margin: 14px 0 0; color: var(--text-muted); font-size: 14.5px; }

@media (max-width: 640px) {
  .search-form { flex-direction: column; align-items: stretch; }
  .search-form .btn { width: 100%; }
  .report-header { flex-direction: column; text-align: center; }
  .report-header__meta { justify-content: center; }
}
