/* =====================================================================
   REFAGRO · слой дизайна v2
   Подключается после styles.css на всех страницах.
   1. Недостающие токены   2. Тёмная тема   3. Шапка и переключатель темы
   4. Первый экран с 3D-контейнером   5. Эффекты карточек и кнопок
   6. Блок заявки внизу страниц   7. Уведомления   8. Мобильная версия
   ===================================================================== */

/* ---------- 1. Токены ---------- */
:root {
  --gray-50: #F8FAFC;
  --gray-900: #0F172A;
  --surface-2: #F1F5F9;
  --ring: rgba(36, 90, 126, .18);
  --glow: rgba(46, 122, 173, .16);
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
  color-scheme: light;
}

/* ---------- 2. Тёмная тема — в палитре подвала ---------- */
html[data-theme="dark"] {
  color-scheme: dark;
  --white: #0F1A2A;          /* фон блоков */
  --bg: #0B1422;             /* фон страницы и секций-подложек */
  --surface: #13233A;
  --surface-2: #172A44;
  --border: #23384F;
  --muted: #1A2C44;
  --text: #E7EEF6;
  --text-secondary: #B2C1D1;
  --text-muted: #7F93A8;
  --blue: #3A86BE;
  --blue-dark: #2F74A8;
  --blue-mid: #2B6C9C;
  --blue-light: #6CB0E0;
  --blue-pale: #15304A;
  --blue-pale-2: #1B3B58;
  --primary: #6CB0E0;
  --primary-light: #15304A;
  --gray-50: #0F1A2A;
  --gray-100: #23384F;
  --gray-200: #1A2C44;
  --gray-400: #7F93A8;
  --gray-500: #8DA1B5;
  --gray-600: #A6B6C7;
  --gray-700: #C2CFDC;
  --gray-800: #DCE5EE;
  --gray-900: #EEF3F8;
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, .35), 0 4px 12px rgba(0, 0, 0, .25);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, .35);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, .45);
  --shadow-card: 0 4px 20px rgba(0, 0, 0, .3);
  --ring: rgba(108, 176, 224, .25);
  --glow: rgba(108, 176, 224, .14);
}
html[data-theme="dark"] body { background: var(--bg); color: var(--text); }
html[data-theme="dark"] .nav-wrapper { background: rgba(11, 20, 34, .88); border-bottom-color: var(--border); }
html[data-theme="dark"] .btn-primary { color: #fff; }
html[data-theme="dark"] .btn-white { background: #fff; color: #245A7E; }
html[data-theme="dark"] .btn-outline { color: var(--blue-light); border-color: var(--blue); }
html[data-theme="dark"] .dropdown { background: var(--surface); border-color: var(--border); }
html[data-theme="dark"] .nav-burger span { background: var(--text); }
html[data-theme="dark"] input, html[data-theme="dark"] select, html[data-theme="dark"] textarea {
  background: var(--surface); color: var(--text); border-color: var(--border);
}
html[data-theme="dark"] input::placeholder, html[data-theme="dark"] textarea::placeholder { color: var(--text-muted); }
html[data-theme="dark"] table, html[data-theme="dark"] th, html[data-theme="dark"] td { border-color: var(--border); }
html[data-theme="dark"] th { background: var(--surface-2); color: var(--text); }
html[data-theme="dark"] footer { background: #070E19; }
html[data-theme="dark"] img.logo-on-light { display: none; }
img.logo-on-dark { display: none; }
html[data-theme="dark"] img.logo-on-dark { display: block; }
html[data-theme="dark"] .modal-box, html[data-theme="dark"] .cookie-banner { background: var(--surface); color: var(--text); border-color: var(--border); }
html[data-theme="dark"] .modal-close { color: var(--text-secondary); }
html[data-theme="dark"] iframe[src*="yandex"] { filter: invert(.9) hue-rotate(180deg) saturate(.7); }
/* мягкий переход при переключении темы */
html.theme-anim, html.theme-anim *, html.theme-anim *::before, html.theme-anim *::after {
  transition: background-color .45s ease, border-color .45s ease, color .35s ease, fill .35s ease, box-shadow .45s ease !important;
}

/* ---------- 3. Переключатель темы ---------- */
.theme-toggle {
  width: 54px; height: 46px; border-radius: var(--r); border: 2px solid transparent;
  background: var(--blue); color: #fff; border-color: transparent; box-shadow: 0 2px 8px rgba(36,90,126,.28), inset 0 1px 0 rgba(255,255,255,.1); display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; position: relative; overflow: hidden; flex-shrink: 0;
  transition: border-color var(--t), transform var(--t), background var(--t);
}
.theme-toggle:hover { background: var(--blue-dark); transform: translateY(-2px); box-shadow: 0 6px 20px rgba(36,90,126,.4); }
.theme-toggle svg { width: 18px; height: 18px; position: absolute; transition: transform .5s var(--ease-spring), opacity .3s ease; }
.theme-toggle .i-moon { transform: rotate(0) scale(1); opacity: 1; }
.theme-toggle .i-sun { transform: rotate(-90deg) scale(.4); opacity: 0; }
html[data-theme="dark"] .theme-toggle .i-moon { transform: rotate(90deg) scale(.4); opacity: 0; }
html[data-theme="dark"] .theme-toggle .i-sun { transform: rotate(0) scale(1); opacity: 1; color: #fff; }
.nav-right-actions { gap: 10px; }
.theme-toggle--mob { display: none; margin-left: auto; margin-right: 8px; }
@media (max-width: 768px) { .theme-toggle--mob { display: inline-flex; width: 40px; height: 40px; } }

/* кнопки в мобильном меню: раньше текст сливался с синей кнопкой */
.mobile-nav a.btn-primary, .mobile-nav a.btn-primary:hover { color: #fff; background: var(--blue); }
.mobile-nav a.btn-outline, .mobile-nav a.btn-outline:hover { color: var(--blue); background: transparent; }
html[data-theme="dark"] .mobile-nav a.btn-outline { color: var(--blue-light); }

/* ---------- 4. Первый экран ---------- */
.hero-x .hero-cinema-overlay {
  background:
    radial-gradient(1200px 600px at 78% 50%, rgba(46, 122, 173, .22), transparent 60%),
    linear-gradient(100deg, rgba(6, 16, 30, .94) 0%, rgba(6, 16, 30, .82) 42%, rgba(6, 16, 30, .45) 100%);
}
.hero-x-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); align-items: center; gap: 24px; }
.hero-x .hero-cinema-content { max-width: 680px; }
.hero-x .hero-cinema-h1 { font-size: clamp(2.1rem, 4.1vw, 3.35rem); }
.hero-x .hero-cinema-h1 em { font-style: normal; color: #8CC8F0; }
.hero-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: -16px 0 30px; }
.hero-chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 99px;
  font-size: .85rem; font-weight: 600; color: rgba(255, 255, 255, .88);
  background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .16);
  transition: background .25s, border-color .25s, transform .25s var(--ease-out);
}
.hero-chip svg { width: 15px; height: 15px; opacity: .8; }
.hero-chip:hover { background: rgba(255, 255, 255, .16); border-color: rgba(255, 255, 255, .4); transform: translateY(-2px); }

/* 3D-сцена */
.c3d-showcase {
  position: relative; height: 500px; perspective: 1600px; border-radius: 24px; overflow: hidden; isolation: isolate;
  background: radial-gradient(520px 300px at 50% 46%, rgba(70, 150, 210, .32), transparent 70%), linear-gradient(160deg, #12304f 0%, #0a1a2e 60%, #07111f 100%);
  box-shadow: 0 30px 60px -20px rgba(8, 20, 38, .45);
}
.c3d-showcase::before {   /* «пол» сцены — сетка в перспективе */
  content: ''; position: absolute; left: -20%; right: -20%; bottom: -10%; height: 60%; z-index: -1;
  background-image: linear-gradient(rgba(140, 200, 240, .14) 1px, transparent 1px), linear-gradient(90deg, rgba(140, 200, 240, .14) 1px, transparent 1px);
  background-size: 46px 46px; transform: perspective(500px) rotateX(62deg); transform-origin: bottom;
  -webkit-mask-image: linear-gradient(to top, #000 10%, transparent 85%); mask-image: linear-gradient(to top, #000 10%, transparent 85%);
}
.c3d-scale { position: absolute; inset: 0; transform-style: preserve-3d; transform: scale(var(--s, 1)); }
.c3d-stage {
  position: absolute; visibility: hidden; left: 50%; top: 50%; width: 0; height: 0; transform-style: preserve-3d;
  transform: rotateX(calc(-16deg + var(--ry, 0deg))) rotateY(calc(-34deg + var(--rx, 0deg)));
  transition: transform .9s var(--ease-out);
}
.c3d-fly { transform-style: preserve-3d; animation: c3dFly 1.9s var(--ease-out) .25s both; }
.c3d-float { transform-style: preserve-3d; animation: c3dFloat 6s ease-in-out 2.2s infinite; }
@keyframes c3dFly {   /* без opacity: анимация прозрачности сплющивает 3D в плоскость */
  0%   { transform: translate3d(620px, -320px, -1100px) rotateY(75deg) rotateZ(-12deg); }
  78%  { transform: translate3d(-10px, 8px, 20px) rotateY(-4deg) rotateZ(1deg); }
  100% { transform: translate3d(0, 0, 0); }
}
@keyframes c3dShow { to { visibility: visible; } }
.c3d-showcase.play .c3d-stage { animation: c3dShow 0s linear .3s forwards; }
.c3d-showcase:not(.play) :is(.c3d-fly, .c3d-float, .c3d-shadow, .hero-float), .c3d-showcase:not(.play) .c3d-side::after { animation-play-state: paused; }
@keyframes c3dFloat { 0%, 100% { transform: translateY(0) rotateY(0); } 50% { transform: translateY(-14px) rotateY(3deg); } }
.c3d { --L: 440px; --H: 128px; --D: 122px; position: absolute; transform-style: preserve-3d; transform: translate3d(calc(var(--L) / -2), calc(var(--H) / -2), 0); }
.c3d-face { position: absolute; left: 0; top: 0; backface-visibility: hidden; border-radius: 3px; overflow: hidden; }
.c3d-side, .c3d-back { width: var(--L); height: var(--H); }
.c3d-end, .c3d-doors { width: var(--D); height: var(--H); }
.c3d-top, .c3d-bottom { width: var(--L); height: var(--D); }
.c3d-side   { transform: translateZ(calc(var(--D) / 2)); }
.c3d-back   { transform: rotateY(180deg) translateZ(calc(var(--D) / 2)); }
.c3d-end    { left: calc((var(--L) - var(--D)) / 2); transform: rotateY(-90deg) translateZ(calc(var(--L) / 2)); }
.c3d-doors  { left: calc((var(--L) - var(--D)) / 2); transform: rotateY(90deg) translateZ(calc(var(--L) / 2)); }
.c3d-top    { top: calc((var(--H) - var(--D)) / 2); transform: rotateX(90deg) translateZ(calc(var(--H) / 2)); }
.c3d-bottom { top: calc((var(--H) - var(--D)) / 2); transform: rotateX(-90deg) translateZ(calc(var(--H) / 2)); background: #0b1626; }
/* гофра белого рефконтейнера */
.c3d-side, .c3d-back, .c3d-doors {
  background:
    linear-gradient(180deg, rgba(255,255,255,.65) 0 4%, transparent 4% 96%, rgba(0,0,0,.18) 96%),
    repeating-linear-gradient(90deg, #f4f7fa 0 9px, #dfe6ee 9px 11px, #fbfdff 11px 18px),
    #eef2f6;
  box-shadow: inset 0 0 0 2px #cfd8e2;
}
.c3d-back { filter: brightness(.82); }
.c3d-top { background: repeating-linear-gradient(90deg, #e9eef3 0 14px, #d7dfe8 14px 16px); filter: brightness(1.04); }
.c3d-side::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 20%, rgba(255,255,255,.55) 32%, transparent 44%);
  transform: translateX(-120%); animation: c3dShine 6.5s ease-in-out 2.4s infinite;
}
@keyframes c3dShine { 0%, 55% { transform: translateX(-120%); } 85%, 100% { transform: translateX(120%); } }
.c3d-logo { position: absolute; left: 50%; top: 54%; width: 46%; height: auto; transform: translate(-50%, -50%); }
.c3d-code { position: absolute; right: 4%; top: 8%; font: 700 8px/1.25 var(--font); color: #5b6f84; letter-spacing: .06em; text-align: right; }
.c3d-code b { display: block; font-size: 11px; color: #24425e; }
/* торец с холодильной установкой */
.c3d-end { background: linear-gradient(180deg, #d9e1ea, #c3cfdb); box-shadow: inset 0 0 0 2px #b4c2cf; filter: brightness(.95); }
.c3d-unit { position: absolute; inset: 10% 10% 10% 10%; border-radius: 4px; background: #1f2f42; box-shadow: inset 0 0 0 2px #2f455d; }
.c3d-fan { position: absolute; left: 14%; top: 14%; width: 56%; aspect-ratio: 1; border-radius: 50%;
  background: repeating-conic-gradient(#3f5873 0 12deg, #22364c 12deg 30deg); animation: c3dSpin 1.4s linear infinite; }
@keyframes c3dSpin { to { transform: rotate(360deg); } }
.c3d-screen { position: absolute; left: 10%; right: 10%; bottom: 12%; height: 22%; border-radius: 3px; background: #031912;
  color: #34f5a5; font: 700 11px/1 ui-monospace, Menlo, monospace; display: flex; align-items: center; justify-content: center;
  text-shadow: 0 0 6px rgba(52, 245, 165, .8); }
/* двери */
.c3d-doors::before, .c3d-doors::after { content: ''; position: absolute; top: 6%; bottom: 6%; width: 3px; background: #9fb0c1; border-radius: 2px; }
.c3d-doors::before { left: 30%; } .c3d-doors::after { left: 66%; }
/* тень на земле */
.c3d-shadow { position: absolute; left: -260px; top: 100px; width: 520px; height: 70px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(0, 0, 0, .55), transparent); transform: rotateX(90deg) translateZ(-90px); filter: blur(6px);
  animation: c3dShadow 6s ease-in-out 2.2s infinite; }
@keyframes c3dShadow { 0%, 100% { opacity: .9; } 50% { opacity: .55; } }

/* плавающие карточки телеметрии */
.hero-float {
  position: absolute; z-index: 3; display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 16px;
  background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .18); color: #fff;
  backdrop-filter: blur(12px) saturate(140%); -webkit-backdrop-filter: blur(12px) saturate(140%);
  box-shadow: 0 18px 40px rgba(0, 0, 0, .28); opacity: 0; transform: translateY(16px);
  animation: heroFloatIn .9s var(--ease-out) forwards, heroBob 5s ease-in-out infinite;
}
.hero-float small { display: block; font-size: .72rem; color: rgba(255, 255, 255, .6); font-weight: 600; letter-spacing: .03em; }
.hero-float strong { font-size: 1rem; font-weight: 800; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.hero-float .dot { width: 9px; height: 9px; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 0 rgba(52, 211, 153, .7); animation: livePulse 2s infinite; flex-shrink: 0; }
.hero-float .ico { width: 34px; height: 34px; border-radius: 10px; background: rgba(255, 255, 255, .12); display: flex; align-items: center; justify-content: center; }
.hero-float .ico svg { width: 18px; height: 18px; }
.hf-temp { right: 5%; top: 6%; animation-delay: 1.5s, 2.4s; }
.hf-acc  { left: 5%; top: 6%; animation-delay: 1.65s, 3.4s; }
.hf-gps  { left: 5%; bottom: 7%; animation-delay: 1.8s, 3.1s; }
.hf-auto { right: 5%; bottom: 7%; animation-delay: 2.1s, 2.7s; }
@keyframes heroFloatIn { to { opacity: 1; transform: translateY(0); } }
@keyframes heroBob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -8px; } }
@keyframes livePulse { 0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, .65); } 70% { box-shadow: 0 0 0 10px rgba(52, 211, 153, 0); } 100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); } }

@media (max-width: 1240px) { .c3d-showcase { --s: .84; } }
@media (max-width: 960px) { .hero-x-grid { grid-template-columns: 1fr; } .c3d-showcase { --s: .9; height: 440px; } }
@media (max-width: 600px) {
  .c3d-showcase { --s: .6; height: 360px; border-radius: 18px; }
  .c3d-showcase .hero-float { padding: 8px 11px; gap: 8px; border-radius: 12px; }
  .c3d-showcase .hero-float strong { font-size: .85rem; } .c3d-showcase .hero-float small { font-size: .62rem; }
  .c3d-showcase .hero-float .ico { width: 26px; height: 26px; } .c3d-showcase :is(.hf-acc, .hf-gps) { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .c3d-fly, .c3d-float, .c3d-fan, .c3d-side::after, .c3d-shadow, .hero-float { animation: none !important; opacity: 1; transform: none; }
}

/* ---------- 5. Эффекты карточек и кнопок ---------- */
.fx-card { position: relative; isolation: isolate; }
.fx-card::after {
  content: ''; position: absolute; inset: -1px; border-radius: inherit; pointer-events: none; z-index: 2; opacity: 0;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), var(--glow), transparent 45%);
  transition: opacity .35s ease;
}
.fx-card:hover::after { opacity: 1; }
.fx-card { transition: transform .45s var(--ease-out), box-shadow .45s var(--ease-out), border-color .3s ease !important; }
.fx-card:hover { box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--blue) 40%, var(--border)); }
.fx-tilt { transform: perspective(900px) rotateX(var(--tx, 0deg)) rotateY(var(--ty, 0deg)) translateY(var(--lift, 0)); will-change: transform; }
.fx-tilt:hover { --lift: -4px; }
/* иконки в карточках слегка оживают */
.fx-card :is(.card-icon, .svc-icon, .exp-ico, .cargo-v2-ico, .about-feat-ico, .dir-icon, .route-card-mode) { transition: transform .5s var(--ease-spring); }
.fx-card:hover :is(.card-icon, .svc-icon, .exp-ico, .cargo-v2-ico, .about-feat-ico, .dir-icon, .route-card-mode) { transform: translateY(-3px) rotate(-4deg) scale(1.06); }
/* стрелки «подробнее» */
.fx-card:hover :is(.dir-card-arrow, .cargo-v2-arrow, .svc-link svg, .exp-link svg, .news-read-more) { transform: translateX(4px); }
:is(.dir-card-arrow, .cargo-v2-arrow, .svc-link svg, .exp-link svg, .news-read-more) { transition: transform .35s var(--ease-out); }
:is(.svc-link svg, .exp-link svg, .news-read-more) { display: inline-block; }   /* кружки со стрелкой остаются flex — стрелка по центру */
/* картинки в карточках новостей и направлений — мягкий зум */
.news-card .news-img img, .dir-card-bg { transition: transform 1.2s var(--ease-out); }
.news-card:hover .news-img img, .dir-card:hover .dir-card-bg { transform: scale(1.06); }
/* кнопки: блик, пробегающий при наведении */
.btn { isolation: isolate; }
.btn::after {
  content: ''; position: absolute; top: 0; bottom: 0; left: -60%; width: 45%; z-index: -1; pointer-events: none;
  background: linear-gradient(105deg, transparent, rgba(255, 255, 255, .28), transparent); transform: skewX(-18deg);
  transition: left .7s var(--ease-out);
}
.btn:hover::after { left: 120%; }
.fx-magnetic { transition: transform .35s var(--ease-out); }
/* ссылки в тексте — подчёркивание вырастает */
.article-body a, .text-link { background: linear-gradient(currentColor, currentColor) 0 100% / 0 1.5px no-repeat; transition: background-size .35s var(--ease-out); text-decoration: none; }
.article-body a:hover, .text-link:hover { background-size: 100% 1.5px; }
/* числа в полосе статистики подсвечиваются при наведении */
.stats-band-item, .hero-cs-item { transition: transform .35s var(--ease-out); }
.stats-band-item:hover, .hero-cs-item:hover { transform: translateY(-3px); }
@media (hover: none) { .fx-card::after, .btn::after { display: none; } .fx-tilt { transform: none !important; } }
@media (prefers-reduced-motion: reduce) { .fx-tilt { transform: none !important; } .btn::after { display: none; } }

/* ---------- 6. Блок заявки внизу страниц ---------- */
.lead-x { padding: 96px 0; background: var(--bg); position: relative; overflow: hidden; }
.lead-x::before {      /* линии маршрутов на фоне */
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background:
    radial-gradient(900px 420px at 10% 0%, var(--glow), transparent 60%),
    radial-gradient(700px 380px at 100% 100%, var(--glow), transparent 60%);
}
.lead-x-card {
  position: relative; display: grid; grid-template-columns: 1.05fr .95fr; gap: 0;
  background: var(--white); border: 1px solid var(--border); border-radius: var(--r-xl); overflow: hidden;
  box-shadow: var(--shadow-card);
}
.lead-x-info { padding: 48px 48px 44px; display: flex; flex-direction: column; }
.lead-x-info h2 { font-size: clamp(1.75rem, 3vw, 2.4rem); font-weight: 800; letter-spacing: -.03em; line-height: 1.1; margin: 14px 0 12px; color: var(--text); }
.lead-x-info > p { color: var(--text-secondary); font-size: 1.02rem; max-width: 460px; margin-bottom: 30px; }
.lead-x-live { display: inline-flex; align-items: center; gap: 9px; align-self: flex-start; padding: 7px 14px 7px 12px; border-radius: 99px;
  background: color-mix(in srgb, #10b981 12%, transparent); color: #059669; font-size: .8rem; font-weight: 700; letter-spacing: .01em; }
html[data-theme="dark"] .lead-x-live { color: #34d399; }
.lead-x-live i { width: 8px; height: 8px; border-radius: 50%; background: #10b981; animation: livePulse 2s infinite; }

/* путь заявки: три шага, которые «оживают» по очереди */
.lead-steps { position: relative; display: grid; gap: 4px; margin-bottom: 32px; }
.lead-steps::before { z-index: 0; content: ''; position: absolute; left: 21px; top: 26px; bottom: 26px; width: 2px; background: var(--border); }
.lead-steps::after { z-index: 0; content: ''; position: absolute; left: 21px; top: 26px; width: 2px; height: var(--progress, 0%); max-height: calc(100% - 52px);
  background: linear-gradient(var(--blue), #10b981); transition: height 1.6s var(--ease-out); }
.lead-step { position: relative; z-index: 1; display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 14px; padding: 10px 0;
  opacity: .45; transform: translateX(-8px); transition: opacity .6s ease, transform .6s var(--ease-out); }
.lead-step.on { opacity: 1; transform: none; }
.lead-step-ico { position: relative; z-index: 1; width: 44px; height: 44px; border-radius: 14px; background: var(--white);
  border: 1.5px solid var(--border); display: flex; align-items: center; justify-content: center; color: var(--text-muted);
  transition: border-color .5s, color .5s, background .5s, transform .6s var(--ease-spring); }
.lead-step-ico svg { width: 20px; height: 20px; }
.lead-step.on .lead-step-ico { border-color: var(--blue); color: var(--blue); background: var(--blue-pale); transform: scale(1.04); }
.lead-step.done .lead-step-ico { border-color: #10b981; color: #fff; background: #10b981; }
.lead-step b { display: block; font-size: .98rem; color: var(--text); font-weight: 700; }
.lead-step span { font-size: .85rem; color: var(--text-muted); }
.lead-step em { font-style: normal; font-size: .78rem; font-weight: 700; color: var(--blue); background: var(--blue-pale);
  padding: 4px 10px; border-radius: 99px; white-space: nowrap; }
.lead-step.done em { color: #059669; background: color-mix(in srgb, #10b981 14%, transparent); }
html[data-theme="dark"] .lead-step em { color: var(--blue-light); }

.lead-x-contacts { display: flex; flex-wrap: wrap; gap: 10px; margin-top: auto; }
.lead-x-contacts .btn { padding: 12px 18px; font-size: .9rem; }
.lead-x-contacts .btn svg { width: 16px; height: 16px; }
.btn-soft { background: var(--blue-pale); color: var(--blue); border: 1px solid transparent; }
.btn-soft:hover { background: var(--blue-pale-2); transform: translateY(-1px); }
html[data-theme="dark"] .btn-soft { color: var(--blue-light); }

/* правая часть — форма */
.lead-x-form-wrap { position: relative; padding: 44px 44px 40px; background: var(--surface-2); border-left: 1px solid var(--border); }
.lead-x-form { display: grid; gap: 14px; }
.lead-x-form .lead-x-title { font-size: 1.1rem; font-weight: 800; color: var(--text); margin-bottom: 4px; }
.lead-x-form label { display: grid; gap: 6px; font-size: .8rem; font-weight: 700; color: var(--text-secondary); }
.lead-x-form input, .lead-x-form textarea {
  font: inherit; font-size: .95rem; font-weight: 500; color: var(--text); background: var(--white);
  border: 1.5px solid var(--border); border-radius: 12px; padding: 13px 14px; transition: border-color .2s, box-shadow .2s; width: 100%;
}
.lead-x-form textarea { min-height: 92px; resize: vertical; }
.lead-x-form input:focus, .lead-x-form textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px var(--ring); }
.lead-x-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.lead-x-consent { display: flex !important; grid-template-columns: none !important; align-items: flex-start; gap: 10px !important; font-weight: 500 !important; font-size: .8rem !important; color: var(--text-muted) !important; }
.lead-x-consent input { width: 18px; height: 18px; margin-top: 1px; flex-shrink: 0; accent-color: var(--blue); }
.lead-x-consent a { color: var(--blue); text-decoration: underline; }
.lead-x-form .form-submit { width: 100%; justify-content: center; padding: 15px 20px; font-size: 1rem; }
.lead-x-note { display: flex; align-items: center; gap: 8px; font-size: .78rem; color: var(--text-muted); }
.lead-x-note svg { width: 14px; height: 14px; flex-shrink: 0; }

/* состояние «заявка отправлена» */
.lead-x-done { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  padding: 40px; background: var(--surface-2); opacity: 0; visibility: hidden; transition: opacity .5s ease, visibility .5s; }
.lead-x-form-wrap.sent .lead-x-done { opacity: 1; visibility: visible; }
.lead-x-done h3 { font-size: 1.4rem; font-weight: 800; color: var(--text); margin: 18px 0 8px; letter-spacing: -.02em; }
.lead-x-done p { color: var(--text-secondary); max-width: 320px; }
.check-anim { width: 84px; height: 84px; }
.check-anim circle { fill: none; stroke: #10b981; stroke-width: 3; stroke-dasharray: 240; stroke-dashoffset: 240; }
.check-anim path { fill: none; stroke: #10b981; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 60; stroke-dashoffset: 60; }
.lead-x-form-wrap.sent .check-anim circle { animation: drawStroke .8s var(--ease-out) .15s forwards; }
.lead-x-form-wrap.sent .check-anim path { animation: drawStroke .5s var(--ease-out) .75s forwards; }
@keyframes drawStroke { to { stroke-dashoffset: 0; } }
/* конвертик улетает к менеджеру */
.mail-fly { position: fixed; z-index: 10000; width: 34px; height: 34px; border-radius: 10px; background: var(--blue); color: #fff;
  display: flex; align-items: center; justify-content: center; pointer-events: none; box-shadow: 0 10px 30px rgba(36, 90, 126, .45); }
.mail-fly svg { width: 18px; height: 18px; }

@media (max-width: 900px) {
  .lead-x { padding: 64px 0; }
  .lead-x-card { grid-template-columns: 1fr; }
  .lead-x-info { padding: 32px 22px 28px; }
  .lead-x-form-wrap { padding: 28px 22px 26px; border-left: 0; border-top: 1px solid var(--border); }
  .lead-x-row { grid-template-columns: 1fr; }
  .lead-x-contacts .btn { flex: 1 1 auto; justify-content: center; }
  .lead-x-info { padding: 28px 18px 24px; }
  .lead-x-form-wrap { padding: 24px 18px 22px; }
  .lead-step { grid-template-columns: 40px 1fr; gap: 12px; align-items: start; }
  .lead-step-ico { width: 40px; height: 40px; border-radius: 12px; }
  .lead-steps::before, .lead-steps::after { left: 19px; }
  .lead-step em { grid-column: 2; justify-self: start; margin-top: -4px; }
}

/* ---------- 7. Уведомления ---------- */
.toast-x { position: fixed; left: 50%; bottom: 28px; z-index: 10001; display: flex; align-items: center; gap: 12px; max-width: min(520px, calc(100vw - 32px));
  padding: 14px 18px; border-radius: 14px; background: #0F172A; color: #fff; font-size: .9rem; box-shadow: 0 18px 40px rgba(0, 0, 0, .3);
  transform: translate(-50%, 140%); transition: transform .5s var(--ease-spring); }
.toast-x.show { transform: translate(-50%, 0); }
.toast-x svg { width: 18px; height: 18px; color: #34d399; flex-shrink: 0; }
.toast-x button { margin-left: 6px; background: rgba(255, 255, 255, .12); color: #fff; border: 0; border-radius: 8px; padding: 6px 10px; font: inherit; font-size: .8rem; font-weight: 700; cursor: pointer; white-space: nowrap; }
html[data-theme="dark"] .toast-x { background: #E7EEF6; color: #0F172A; }
html[data-theme="dark"] .toast-x button { background: rgba(15, 23, 42, .1); color: #0F172A; }

/* ---------- 8. Прокрутка: тонкая полоса прогресса в шапке ---------- */
.scroll-progress { position: fixed; left: 0; top: 0; height: 2px; width: 100%; z-index: 1001; transform-origin: 0 50%; transform: scaleX(var(--p, 0));
  background: linear-gradient(90deg, var(--blue), #10b981); pointer-events: none; }

/* ---------- 2б. Тёмная тема: блоки со своими стилями на отдельных страницах ---------- */
html[data-theme="dark"] :is(.route-card, .compat-card, .compat-legend, .cont-type-card, .dept-table, .press-tag) { background: var(--surface) !important; border-color: var(--border) !important; color: var(--text); }
html[data-theme="dark"] :is([style*="background:white"], [style*="background: white"], [style*="background:#fff"], [style*="background: #fff"], [style*="background:#FFF"]) { background: var(--surface) !important; }
html[data-theme="dark"] :is(h1, h2, h3, h4, .route-card-city, .compat-card-name, .cont-type-badge, .dept-table a, .dept-table div) { color: var(--text); }
html[data-theme="dark"] :is(.page-header p, .section-header p, .article-body p, .article-body li) { color: var(--text-secondary); }
html[data-theme="dark"] .compat-badge { filter: saturate(.8) brightness(.9); }
/* карта маршрутов остаётся светлой иллюстрацией — так читаются подписи городов */
html[data-theme="dark"] .route-map-container { border-color: var(--border); box-shadow: none; }

/* ---------- 9. Шапки внутренних страниц — в одной системе с первым экраном главной ---------- */
.page-header { position: relative; overflow: hidden; }
.page-header:not(.page-header--photo)::after {     /* мягкое свечение, как в блоке заявки */
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(800px 360px at 85% 0%, var(--glow), transparent 65%);
}
.page-header .container { position: relative; z-index: 1; }
.page-header--photo { padding: 150px 0 72px; background-color: #0B1626; background-position: var(--fx, 50%) var(--fy, 40%); }   /* точка фокуса — на контейнере, поезде, судне */
.page-header--photo::before { background: linear-gradient(105deg, rgba(8,20,38,.92) 0%, rgba(8,20,38,.74) 48%, rgba(8,20,38,.38) 100%); }
.page-header--photo h1 { font-size: clamp(2rem, 4.2vw, 3.2rem); letter-spacing: -.03em; max-width: 820px; }
.page-header--photo p { max-width: 620px; }
.page-header--photo .badge { backdrop-filter: blur(6px); }
@media (prefers-reduced-motion: no-preference) {
  .page-header .breadcrumb, .page-header .badge, .page-header h1, .page-header p { animation: heroFadeUp .7s var(--ease-out) both; }
  .page-header .badge { animation-delay: .05s; } .page-header h1 { animation-delay: .1s; } .page-header p { animation-delay: .2s; }
}
@media (max-width: 768px) { .page-header--photo { padding: 116px 0 48px; background-position: var(--fx, 50%) var(--fy, 40%); } }
html[data-theme="dark"] .page-header--photo :is(h1, p) { color: #fff; }

/* ---------- 10. Первый экран v3: табло маршрутов, иней, акцент заголовка ---------- */
.hero-x .hero-cinema-video { animation: kenBurns 18s ease-out both; }
.hero-x::after {   /* мягкий переход видео в страницу */
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 140px; pointer-events: none; z-index: 0;
  background: linear-gradient(to top, rgba(6, 16, 30, .75), transparent);
}
.hero-frost { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.hero-glow { position: absolute; left: 0; top: 0; width: 840px; height: 840px; margin: -420px 0 0 -420px; z-index: 0; pointer-events: none; opacity: 0;
  transition: opacity .6s; will-change: transform; transform: translate3d(var(--gx, 70vw), var(--gy, 40vh), 0);
  background: radial-gradient(closest-side, rgba(120, 190, 240, .16), transparent); }
.hero-x:hover .hero-glow { opacity: 1; }
.hero-x .container { position: relative; z-index: 1; }
.hero-x .hero-cinema-h1 em {
  font-style: normal; white-space: nowrap;
  background: linear-gradient(100deg, #8CC8F0 0%, #d9f0ff 35%, #8CC8F0 55%, #5fb0e6 100%); background-size: 220% 100%;
  background-position: 100% 0; -webkit-background-clip: text; background-clip: text; color: transparent; animation: hShimmer 7s ease-in-out 1.2s 3 both;
}
@keyframes hShimmer { 0%, 100% { background-position: 100% 0; } 50% { background-position: 0 0; } }

/* табло: сроки в пути */
.hero-board {
  position: relative; justify-self: end; width: min(440px, 100%); padding: 22px 22px 18px; border-radius: 22px; color: #fff;
  background: linear-gradient(160deg, rgba(255, 255, 255, .13), rgba(255, 255, 255, .05));
  border: 1px solid rgba(255, 255, 255, .18); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 30px 70px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .15);
  animation: heroFadeUp .9s var(--ease-out) .35s both;
}
.hero-board::before {  /* бегущий блик по рамке */
  content: ''; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; pointer-events: none;
  background: linear-gradient(140deg, rgba(140, 200, 240, .75), transparent 35%, transparent 65%, rgba(140, 200, 240, .45));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
}
.hb-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.hb-title { font-size: .78rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: rgba(255, 255, 255, .6); }
.hb-live { display: inline-flex; align-items: center; gap: 7px; font-size: .75rem; font-weight: 700; color: #6ee7b7; }
.hb-live i { width: 8px; height: 8px; border-radius: 50%; background: #34d399; animation: livePulse 2s infinite; }
.hb-tabs { display: flex; gap: 6px; padding: 4px; border-radius: 12px; background: rgba(0, 0, 0, .22); margin-bottom: 10px; }
.hb-tab { flex: 1; padding: 8px 6px; border: 0; border-radius: 9px; background: transparent; color: rgba(255, 255, 255, .65);
  font: 700 .8rem/1 var(--font); cursor: pointer; transition: background .25s, color .25s; }
.hb-tab[aria-selected="true"] { background: rgba(255, 255, 255, .16); color: #fff; }
.hb-tab:hover { color: #fff; }
.hb-list { list-style: none; margin: 0; padding: 0; display: grid; }
.hb-list[hidden] { display: none; }
.hb-row { position: relative; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 4px 12px; padding: 11px 12px; border-radius: 12px;
  transition: background .35s; animation: hbIn .5s var(--ease-out) both; }
.hb-row:nth-child(2) { animation-delay: .06s; } .hb-row:nth-child(3) { animation-delay: .12s; } .hb-row:nth-child(4) { animation-delay: .18s; }
@keyframes hbIn { from { opacity: 0; transform: translateX(12px); } }
.hb-row + .hb-row { border-top: 1px solid rgba(255, 255, 255, .08); }
.hb-row.on { background: rgba(255, 255, 255, .09); border-top-color: transparent; }
.hb-row.on + .hb-row { border-top-color: transparent; }
.hb-route { font-weight: 700; font-size: .95rem; letter-spacing: -.01em; }
.hb-route span { color: rgba(255, 255, 255, .45); margin: 0 6px; }
.hb-days { font-weight: 800; font-size: .95rem; font-variant-numeric: tabular-nums; color: #bfe3fa; white-space: nowrap; }
.hb-meta { grid-column: 1 / -1; font-size: .74rem; color: rgba(255, 255, 255, .5); }
.hb-track { grid-column: 1 / -1; height: 3px; border-radius: 3px; background: rgba(255, 255, 255, .1); overflow: hidden; display: none; }
.hb-row.on .hb-track { display: block; }
.hb-track b { display: block; height: 100%; width: 100%; transform: scaleX(0); transform-origin: left; border-radius: inherit; background: linear-gradient(90deg, #5fb0e6, #a7f3d0); }
.hb-row.on .hb-track b { animation: hbTrack 3.2s linear forwards; }
@keyframes hbTrack { to { transform: scaleX(1); } }
.hb-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, .1); }
.hb-foot small { font-size: .74rem; color: rgba(255, 255, 255, .55); line-height: 1.35; }
.hb-foot .btn { padding: 10px 16px; font-size: .85rem; white-space: nowrap; }
@media (max-width: 960px) { .hero-board { justify-self: stretch; width: 100%; margin: -12px 0 40px; } }
@media (prefers-reduced-motion: reduce) {
  .hero-x .hero-cinema-video, .hero-x .hero-cinema-h1 em, .hero-board, .hero-board::before, .hb-row { animation: none !important; }
}
.hero-frost { width: 100%; height: 100%; }
@media (max-width: 600px) { .hero-x .hero-cinema-h1 em { white-space: normal; } }
@media (max-width: 600px) {
  .hero-board { padding: 18px 14px 14px; }
  .hb-head { flex-wrap: wrap; gap: 6px; }
  .hb-row { padding: 10px; }
  .hb-foot { flex-direction: column; align-items: stretch; text-align: center; }
  .hb-foot small br { display: none; }
  .hb-foot .btn { justify-content: center; }
}

/* ---------- 11. Полосы с цифрами — единый вид на всех страницах (карточка в системе сайта) ---------- */
.stats-band, .stats-strip, .photo-stats { background: var(--bg); padding: 56px 0; }
.stats-strip::before, .photo-stats::before, .photo-stats::after { display: none; }
:is(.stats-band-inner, .stats-inner, .photo-stats-inner) {
  position: relative; gap: 0; overflow: hidden; border-radius: 24px; padding: 34px 12px;
  background: var(--white); border: 1px solid var(--border);
  box-shadow: 0 24px 50px -30px rgba(15, 35, 60, .35);
}
:is(.stats-band-inner, .stats-inner, .photo-stats-inner)::before {   /* мягкое свечение, как у блока заявки */
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(600px 200px at 15% 0%, var(--glow), transparent 70%), radial-gradient(600px 200px at 85% 100%, var(--glow), transparent 70%);
}
:is(.stats-band-item, .stat-item, .photo-stat-item) { position: relative; color: var(--text); border-right: 1px solid var(--border) !important; padding: 6px 20px; }
:is(.stats-band-item, .stat-item, .photo-stat-item):last-child { border-right: 0 !important; }
:is(.stats-band-val, .stat-value, .photo-stat-value) {
  color: var(--blue); background: linear-gradient(135deg, var(--blue) 0%, #4FA3DA 100%); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; font-weight: 800; letter-spacing: -.035em; line-height: 1.05; font-variant-numeric: tabular-nums;
}
.stats-band-pulse { -webkit-text-fill-color: transparent; }
:is(.stats-band-lbl, .stat-label, .photo-stat-label) { color: var(--text-secondary); opacity: 1; font-size: .86rem; margin-top: 8px; }
.photo-stat-icon { background: var(--blue-pale) !important; color: var(--blue) !important; border-color: transparent !important; }
html[data-theme="dark"] :is(.stats-band-inner, .stats-inner, .photo-stats-inner) { background: var(--surface); box-shadow: 0 24px 50px -30px rgba(0, 0, 0, .7); }
html[data-theme="dark"] :is(.stats-band-val, .stat-value, .photo-stat-value) { background-image: linear-gradient(135deg, #9BD3F7 0%, #5FB0E6 100%); }
@media (max-width: 768px) {
  :is(.stats-band-inner, .stats-inner, .photo-stats-inner) { padding: 22px 8px; gap: 18px 0 !important; }
  :is(.stats-band-item, .stat-item, .photo-stat-item) { border-right: 0 !important; border-bottom: 0 !important; padding: 8px 10px !important; }
}

.c3d-showcase.off :is(.c3d-fly, .c3d-float, .c3d-shadow, .c3d-fan, .hero-float), .c3d-showcase.off .c3d-side::after { animation-play-state: paused; }

/* ---------- 12. Плавное появление при прокрутке ----------
   Эффекты наведения у карточек задают свой transition и раньше перебивали появление: блок возникал рывком.
   Пока блок проявляется — работает только плавное появление, потом (класс aos-done) возвращаются эффекты наведения. */
@media (prefers-reduced-motion: no-preference) {
  .aos:not(.aos-done) {
    transition: opacity .8s cubic-bezier(.22, 1, .36, 1), transform .8s cubic-bezier(.22, 1, .36, 1) !important;
  }
  .aos { backface-visibility: hidden; }
}

/* ---------- 13. Карточки направлений: текст на фото читается ---------- */
.dir-card-overlay { background: linear-gradient(to top, rgba(6, 16, 30, .72) 0%, rgba(6, 16, 30, .28) 55%, rgba(6, 16, 30, .12) 100%); }
.dir-card { min-height: 360px; }
.dir-card-body {
  margin: 12px; padding: 14px 18px 14px; border-radius: 16px;
  background: rgba(8, 20, 38, .42); border: 1px solid rgba(255, 255, 255, .12);
  backdrop-filter: blur(8px) saturate(120%); -webkit-backdrop-filter: blur(8px) saturate(120%);
}
.dir-card-tag { color: rgba(255, 255, 255, .7); }
.dir-card-tag { margin-bottom: 6px; }
.dir-card h3 { margin-bottom: 4px; }
.dir-card p { color: rgba(255, 255, 255, .88); margin-bottom: 12px; }
.dir-card-arrow { width: 32px; height: 32px; }
.dir-icon { background: rgba(8, 20, 38, .5); border: 1px solid rgba(255, 255, 255, .14); color: #fff;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
@media (max-width: 768px) { .dir-card { min-height: 260px; } .dir-card-body { margin: 10px; padding: 12px 14px; } }
