/* ===================================================================
   PidvezU — головна сторінка. Тема через CSS-змінні (dark / light).
   =================================================================== */

/* ---------- Тема: dark (за замовчуванням) ---------- */
:root {
  --bg-1: #141333;
  --bg-2: #1a1b4d;
  --surface: rgba(20, 19, 51, 0.72);
  --surface-solid: #1b1a48;
  --surface-2: rgba(130, 131, 255, 0.08);
  --border: rgba(130, 131, 255, 0.18);
  --border-strong: rgba(130, 131, 255, 0.35);
  --text: #ffffff;
  --text-muted: #b9bae6;
  --text-dim: #8687b8;
  --accent: #8283ff;
  --accent-2: #4b4ded;
  --accent-contrast: #ffffff;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
  --shadow-sm: 0 8px 24px rgba(0, 0, 0, 0.3);
  --glow: rgba(130, 131, 255, 0.35);
  --header-bg: rgba(16, 15, 43, 0.75);
  --dp-bg: #262552;
  --success: #46d39a;
  color-scheme: dark;
}

/* ---------- Тема: light ---------- */
:root[data-theme="light"] {
  --bg-1: #eef0fb;
  --bg-2: #e2e5ff;
  --surface: rgba(255, 255, 255, 0.85);
  --surface-solid: #ffffff;
  --surface-2: rgba(75, 77, 237, 0.06);
  --border: rgba(35, 36, 92, 0.12);
  --border-strong: rgba(75, 77, 237, 0.32);
  /* Індигово-фіолетовий у тон бренду, а НЕ чорний. Попередній #262a4d давав
     контраст 12:1 — технічно бездоганно, але око читало його як чорнило.
     #3d4178 світліший (9.4:1 на білому, все ще AAA) і має помітний фіолетовий
     підтон — текст виглядає навмисно кольоровим, а не чорним. */
  --text: #3d4178;
  --text-muted: #605d8a;
  --text-dim: #8b8db3;
  --accent: #4b4ded;
  --accent-2: #6b6cf0;
  --accent-contrast: #ffffff;
  --shadow: 0 20px 50px rgba(35, 36, 92, 0.14);
  --shadow-sm: 0 8px 24px rgba(35, 36, 92, 0.1);
  --glow: rgba(75, 77, 237, 0.25);
  --header-bg: rgba(255, 255, 255, 0.8);
  --dp-bg: #ffffff;
  --success: #14a06f;
  color-scheme: light;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; overflow-x: hidden; }

body {
  font-family: 'Montserrat', system-ui, sans-serif;
  background:
    radial-gradient(1000px 600px at 85% -10%, var(--glow), transparent 60%),
    linear-gradient(160deg, var(--bg-1) 0%, var(--bg-2) 100%);
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
  /* clip, а не hidden: hidden на body робить його контейнером прокрутки
     і ламає position:sticky у шапки та навігації застосунку */
  overflow-x: clip;
  max-width: 100%;
  line-height: 1.6;
  transition: background-color .4s ease, color .4s ease;
}

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

/* Мобільні браузери малюють напівпрозорий синій «спалах» під пальцем на будь-якому
   посиланні/кнопці (а посилання-кнопки при натисканні ще й підсвічували підпис синім).
   Прибираємо підсвітку тапа скрізь; для елементів-кнопок додатково блокуємо
   виділення тексту, щоб напис не ставав синім при кліку. */
a, button, label, summary, [role="button"], .btn { -webkit-tap-highlight-color: transparent; }
button, label.file-drop, [role="button"], .btn,
a.btn, a.btn-primary, a.btn-secondary, a.btn-nav-ico, a.btn-nav-login,
a.qa-tile, a.bk-btn, a.mt-btn, a.up-btn, a.seo-cta-btn, a.empty-btn, a.bk-ic, a.mt-ic {
  -webkit-user-select: none;
  user-select: none;
}

/* ---- Скролбар у тон теми ---- */
* { scrollbar-width: thin; scrollbar-color: var(--accent) transparent; }
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: linear-gradient(var(--accent), var(--accent-2)); border-radius: 20px; border: 3px solid var(--bg-1); }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ---------- Мʼякі свічення на фоні (замість частинок) ---------- */
.bg-blobs { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.blob { position: absolute; border-radius: 50%; filter: blur(80px); opacity: .42; will-change: transform; }
.blob.b1 { width: 420px; height: 420px; background: var(--accent);   top: -120px;  left: -80px;   animation: blobFloat 20s ease-in-out infinite; }
.blob.b2 { width: 360px; height: 360px; background: var(--accent-2); top: 24%;     right: -120px; animation: blobFloat 26s ease-in-out infinite reverse; }
.blob.b3 { width: 340px; height: 340px; background: #8586ff;         bottom: -140px; left: 28%;    animation: blobFloat 23s ease-in-out infinite; }
:root[data-theme="light"] .blob { opacity: .26; }
@keyframes blobFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%      { transform: translate(50px, 40px) scale(1.1); }
  66%      { transform: translate(-30px, 25px) scale(.95); }
}
/* залишається для .cta::after */
@keyframes floatUp {
  0%   { transform: translateY(0) scale(1); opacity: 0; }
  10%  { opacity: .4; }
  90%  { opacity: .3; }
  100% { transform: translateY(-120vh) scale(1.4); opacity: 0; }
}

/* ---------- Анімації появи ---------- */
.reveal { opacity: 0; transform: translateY(36px); transition: opacity .7s ease, transform .7s cubic-bezier(.2,.7,.2,1); }
.reveal.visible { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: .08s; }
.reveal.d2 { transition-delay: .16s; }
.reveal.d3 { transition-delay: .24s; }
.reveal.d4 { transition-delay: .32s; }

@keyframes fadeDown { from { opacity: 0; transform: translateY(-16px);} to { opacity:1; transform:none; } }
@keyframes shimmer { to { background-position: 200% center; } }
@keyframes pulseGlow { 0%,100%{ box-shadow: 0 0 0 0 var(--glow);} 50%{ box-shadow: 0 0 0 14px transparent;} }

.container { max-width: 1180px; margin: 0 auto; padding: 0 20px; position: relative; }

/* =================== ШАПКА =================== */
/* Шапка статична — без появи з анімацією (вона мигала при кожному переході
   і не збігалась із навігацією, яка з'являлась окремо). */
.header {
  position: sticky; top: 0; z-index: 50;
  border-bottom: 1px solid var(--border);
}
/* Розмиття й фон — на псевдоелементі, а НЕ на самій шапці.
   backdrop-filter створює containing block для position:fixed нащадків,
   а всередині шапки лежить .app-nav, який на мобільному має бути
   прибитий до низу екрана. */
.header::before {
  content: "";
  position: absolute; inset: 0;
  z-index: -1;
  backdrop-filter: blur(14px);
  background: var(--header-bg);
}
.nav-container {
  max-width: 1180px; margin: 0 auto; padding: 14px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.logo { height: 40px; filter: drop-shadow(0 4px 12px var(--glow)); }
.nav-menu { list-style: none; display: flex; align-items: center; gap: 12px; }
.user-greeting { color: var(--text-muted); font-weight: 500; font-size: 14px; }
@media (max-width: 620px){ .user-greeting{ display:none; } }

.btn-nav-login, .btn-nav-logout, .btn-nav-search {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 16px; border-radius: 12px; font-weight: 600; font-size: 14px;
  border: 1px solid var(--border-strong);
  color: var(--text); transition: .25s;
}
.btn-nav-login:hover, .btn-nav-logout:hover, .btn-nav-search:hover {
  background: var(--accent); color: var(--accent-contrast); transform: translateY(-2px);
  box-shadow: 0 8px 20px var(--glow);
}
.btn-nav-search { padding: 9px 13px; }

/* Кнопки-іконки в шапці (вхід / кабінет / вихід).
   Розмір і радіус збігаються з .theme-toggle, щоб увесь ряд читався
   як одна група, а не як «кнопка + щось поруч». Текст замінюють
   aria-label/title — без них іконка нічого не пояснює. */
.btn-nav-ico {
  width: 42px; height: 42px; border-radius: 12px;
  display: inline-grid; place-items: center; flex: 0 0 auto;
  font-size: 16px; line-height: 1;
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--accent); transition: .25s;
}
/* Оптичне вирівнювання сусідніх іконок шапки. Коробки однакові (42×42, 16px),
   але гліфи FA — ні: «дім» ширший за дзвіночок на чверть при однаковій висоті
   (114 проти 91 юніта, виміряно), тож у ряду читався помітно більшим.
   Зменшуємо саме широкі гліфи — так їхній габарит збігається з дзвіночком.
   Розмір в em, а не в px: на мобільному кнопка зменшується до 15px, і жорсткі
   14px зробили б «дім» майже врівень із коробкою. */
.btn-nav-ico .fa-house, .btn-nav-ico .fa-house-user { font-size: .875em; }

.btn-nav-ico:hover {
  background: var(--accent); color: var(--accent-contrast);
  border-color: var(--accent); transform: translateY(-2px);
  box-shadow: 0 8px 20px var(--glow);
}
/* Вихід — приглушений, щоб не конкурував із кабінетом за увагу */
.btn-nav-ico.is-exit { color: var(--text-muted); }
.btn-nav-ico.is-exit:hover { background: #e63946; border-color: #e63946; color: #fff; box-shadow: 0 8px 20px rgba(230,57,70,.35); }
.btn-nav-ico:focus-visible, .theme-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Перемикач теми */
.theme-toggle {
  width: 42px; height: 42px; border-radius: 12px; cursor: pointer;
  display: inline-grid; place-items: center;
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--accent); transition: .25s;
}
.theme-toggle:hover { transform: translateY(-2px) rotate(12deg); box-shadow: 0 8px 20px var(--glow); }
.theme-toggle svg { width: 20px; height: 20px; }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="light"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: none; }

/* =================== HERO =================== */
.hero { padding: 70px 0 40px; text-align: center; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 16px; border-radius: 999px; margin-bottom: 22px;
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--accent); font-weight: 600; font-size: 13px;
  animation: pulseGlow 3s ease-in-out infinite;
}
.hero-title {
  font-size: clamp(34px, 6vw, 64px); font-weight: 800; line-height: 1.08;
  letter-spacing: -.02em; margin-bottom: 18px;
}
.hero-title .grad {
  background: linear-gradient(100deg, var(--accent), #b7b8ff, var(--accent-2), var(--accent));
  background-size: 200% auto; -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; animation: shimmer 5s linear infinite;
}
.hero-subtitle {
  max-width: 640px; margin: 0 auto 30px; font-size: clamp(15px, 2vw, 19px);
  color: var(--text-muted);
}

/* Пошук на головній */
.hero-search {
  max-width: 900px; margin: 0 auto 26px; padding: 12px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 20px; box-shadow: var(--shadow); backdrop-filter: blur(10px);
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px;
}
.hero-search .field { position: relative; }
.hero-search .field i {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--accent); font-size: 15px;
}
.hero-search input {
  width: 100%; padding: 15px 14px 15px 40px; border-radius: 14px;
  border: 1px solid var(--border); background: var(--surface-2);
  color: var(--text); font-size: 15px; font-family: inherit; transition: .2s;
}
.hero-search input::placeholder { color: var(--text-dim); }
.hero-search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--glow); }
.hero-search input[type="date"] { min-width: 150px; }
.hero-search .btn-go {
  grid-column: 1 / -1;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 15px 26px; border: none; border-radius: 14px; cursor: pointer;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; font-weight: 700; font-size: 15px; font-family: inherit;
  transition: .25s; white-space: nowrap;
}
.hero-search .btn-go:hover { transform: translateY(-2px); box-shadow: 0 12px 28px var(--glow); }
@media (max-width: 780px){ .hero-search{ grid-template-columns: minmax(0, 1fr); } }

.hero-quick {
  display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-bottom: 10px;
}
.hero-quick a { font-size: 14px; color: var(--text-muted); display: inline-flex; align-items: center; gap: 6px; transition: .2s; }
.hero-quick a:hover { color: var(--accent); }

/* =================== СТАТИСТИКА =================== */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin: 46px 0; }
.stat-card {
  padding: 26px 18px; text-align: center; border-radius: 18px;
  background: var(--surface); border: 1px solid var(--border); transition: .3s;
}
.stat-card:hover { transform: translateY(-6px); border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.stat-number {
  font-size: clamp(28px, 4vw, 40px); font-weight: 800; line-height: 1;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.stat-label { margin-top: 8px; color: var(--text-muted); font-size: 14px; font-weight: 500; }
@media (max-width: 620px){ .stats{ grid-template-columns: repeat(2,1fr);} }

/* =================== СЕКЦІЇ =================== */
section.block { padding-top: 56px; padding-bottom: 56px; }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 40px; }
.section-title { font-size: clamp(26px, 4vw, 40px); font-weight: 800; letter-spacing: -.02em; }
.section-sub { margin-top: 12px; color: var(--text-muted); }

/* Поїздки-превʼю */
.trips-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.trip-card {
  padding: 22px; border-radius: 18px; background: var(--surface);
  border: 1px solid var(--border); transition: .3s;
}
.trip-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-sm); border-color: var(--border-strong); }
.trip-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.trip-date-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--accent); background: var(--surface-2); padding: 6px 12px; border-radius: 999px; }
.trip-seats-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--success); }
.trip-route { display: flex; flex-direction: column; margin-bottom: 16px; }
.trip-point { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 16px; }
.trip-point .city { min-width: 0; overflow-wrap: anywhere; }
.trip-point .dot { width: 12px; height: 12px; border-radius: 50%; flex: 0 0 auto; }
.trip-point .dot.from { background: var(--accent); }
.trip-point .dot.to { background: var(--accent-2); box-shadow: 0 0 0 4px var(--glow); }
.trip-line { width: 2px; height: 20px; margin: 3px 0 3px 5px; background: linear-gradient(var(--accent), var(--accent-2)); border-radius: 2px; }
.trip-foot { display: flex; gap: 18px; padding-top: 14px; border-top: 1px solid var(--border); color: var(--text-muted); font-size: 14px; flex-wrap: wrap; }
.trip-foot span { display: inline-flex; align-items: center; gap: 6px; min-width: 0; overflow-wrap: anywhere; }
.trip-foot i { color: var(--accent); }
.trips-empty { text-align: center; padding: 40px; color: var(--text-muted); grid-column: 1/-1; }
.trips-empty i { font-size: 40px; color: var(--accent); display:block; margin-bottom: 12px; }

/* Переваги */
.features-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.feature-card {
  padding: 28px 24px; border-radius: 18px; background: var(--surface);
  border: 1px solid var(--border); transition: .3s;
}
.feature-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-sm); border-color: var(--border-strong); }
.feature-icon {
  width: 54px; height: 54px; border-radius: 14px; display: grid; place-items: center;
  font-size: 22px; color: #fff; margin-bottom: 16px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 8px 20px var(--glow);
}
.feature-title { font-size: 19px; font-weight: 700; margin-bottom: 8px; }
.feature-description { color: var(--text-muted); font-size: 15px; }

/* Як це працює */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; }
.step { text-align: center; padding: 24px; position: relative; }
.step-num {
  width: 60px; height: 60px; margin: 0 auto 16px; border-radius: 50%;
  display: grid; place-items: center; font-size: 24px; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 10px 26px var(--glow);
}
.step h3 { font-size: 18px; margin-bottom: 8px; }
.step p { color: var(--text-muted); font-size: 14px; }

/* FAQ */
.faq { max-width: 780px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; }
.faq-item { border: 1px solid var(--border); border-radius: 16px; background: var(--surface); overflow: hidden; transition: .3s; }
.faq-item.open { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.faq-q {
  width: 100%; text-align: left; cursor: pointer; border: none; background: none; color: var(--text);
  font-family: inherit; font-size: 16px; font-weight: 600; padding: 18px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
}
.faq-q .chev { color: var(--accent); transition: transform .3s; flex: 0 0 auto; }
.faq-item.open .chev { transform: rotate(180deg); }
.faq-a { max-height: 0; overflow: hidden; transition: max-height .35s ease; color: var(--text-muted); }
.faq-a > div { padding: 0 20px 18px; }

/* CTA */
.cta {
  position: relative; overflow: hidden; border-radius: 28px; margin: 40px 0;
  padding: 56px 30px; text-align: center;
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  box-shadow: 0 30px 60px var(--glow);
}
.cta-glow { position: absolute; width: 460px; height: 460px; border-radius: 50%; top: -180px; right: -120px; pointer-events: none;
  background: radial-gradient(circle, rgba(255,255,255,.28), transparent 62%); animation: blobFloat 16s ease-in-out infinite; }
.cta-inner { position: relative; z-index: 1; }
.cta-icon { width: 64px; height: 64px; margin: 0 auto 18px; border-radius: 18px; display: grid; place-items: center; font-size: 26px; color: #fff; background: rgba(255,255,255,.2); }
.cta-title { color: #fff; font-size: clamp(26px, 4vw, 38px); font-weight: 800; margin-bottom: 12px; letter-spacing: -.02em; }
.cta-description { color: rgba(255,255,255,.92); max-width: 560px; margin: 0 auto 26px; }
.cta-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* Кнопки */
.btn-primary, .btn-secondary {
  display: inline-flex; align-items: center; gap: 9px; justify-content: center;
  padding: 15px 30px; border-radius: 14px; font-weight: 700; font-size: 16px;
  cursor: pointer; transition: .28s; border: 2px solid transparent;
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff;
  box-shadow: 0 10px 28px var(--glow);
}
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 16px 36px var(--glow); }
.btn-secondary { background: var(--surface-2); color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover { transform: translateY(-3px); background: var(--surface); }
.btn-light, .btn-ghost {
  display: inline-flex; align-items: center; gap: 9px; justify-content: center;
  padding: 15px 28px; border-radius: 14px; font-weight: 700; font-size: 16px; cursor: pointer; transition: .28s; border: 2px solid transparent;
}
.btn-light { background: #fff; color: var(--accent-2); box-shadow: 0 12px 30px rgba(0,0,0,.18); }
.btn-light:hover { transform: translateY(-3px); box-shadow: 0 18px 40px rgba(0,0,0,.24); }
.btn-ghost { background: rgba(255,255,255,.14); color: #fff; border-color: rgba(255,255,255,.5); }
.btn-ghost:hover { transform: translateY(-3px); background: rgba(255,255,255,.24); }
.hero-buttons { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 6px; }

/* ---- Кнопки в CTA-плашці ----
   Плашка завжди залита градієнтом акценту (в обох темах), тож кольори тут
   жорсткі — біле/прозоре, а не змінні теми: інакше в світлій темі кнопка
   зливалася б із фоном плашки. */
.cta-actions .cta-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 16px 30px; border-radius: 16px;
  font-weight: 800; font-size: 16px; letter-spacing: -.01em;
  background: #fff; color: var(--accent-2);
  border: 2px solid #fff;
  box-shadow: 0 14px 30px rgba(0, 0, 0, .22);
  transition: transform .25s, box-shadow .25s, background .25s, border-color .25s;
}
.cta-actions .cta-btn i { font-size: 15px; }
.cta-actions .cta-btn:hover { transform: translateY(-3px); box-shadow: 0 20px 42px rgba(0, 0, 0, .3); }
/* Друга кнопка — «скляна»: помітна рамка + підкладка, бо напівпрозорий
   варіант на градієнті раніше майже не читався */
.cta-actions .cta-btn.alt {
  background: rgba(255, 255, 255, .18);
  border-color: rgba(255, 255, 255, .85);
  color: #fff;
  box-shadow: 0 8px 22px rgba(0, 0, 0, .16);
  backdrop-filter: blur(6px);
}
.cta-actions .cta-btn.alt:hover { background: rgba(255, 255, 255, .32); border-color: #fff; }
.cta-actions .cta-btn:focus-visible { outline: 3px solid rgba(255, 255, 255, .9); outline-offset: 3px; }
/* На телефоні — стовпчиком на всю ширину, з гарантованим просвітом між ними */
@media (max-width: 560px) {
  .cta-actions { flex-direction: column; align-items: stretch; gap: 12px; }
  .cta-actions .cta-btn { width: 100%; padding: 15px 20px; }
}

/* Футер */
.footer { padding: 50px 0 26px; border-top: 1px solid var(--border); margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 34px; padding-bottom: 34px; }

/* ── Унікальний футер: «дорога» замість верхньої лінії ── */
.footer-v2 { border-top: none; padding-top: 30px; overflow: hidden; }
.foot-road { position: relative; height: 44px; margin-bottom: 26px; }
.foot-road-line {
  position: absolute; top: 50%; left: 2%; right: 2%; height: 3px; transform: translateY(-50%);
  background: repeating-linear-gradient(90deg, var(--border-strong) 0 14px, transparent 14px 27px);
  border-radius: 3px;
}
.foot-pin {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
  width: 32px; height: 32px; display: grid; place-items: center;
  border-radius: 50%; background: var(--surface-2); border: 1px solid var(--border-strong);
  font-size: 13px;
}
.foot-pin-a { left: 0; color: var(--accent); }
.foot-pin-b { right: 0; color: #22c55e; }
.foot-car {
  position: absolute; top: 50%; left: 6%; z-index: 3;
  transform: translateY(-62%);
  color: var(--accent); font-size: 25px;
  filter: drop-shadow(0 6px 12px var(--glow));
  animation: footDrive 6.5s ease-in-out infinite;
}
@keyframes footDrive {
  0%   { left: 6%;  opacity: 0; }
  9%   { opacity: 1; }
  88%  { opacity: 1; }
  100% { left: 88%; opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .foot-car { animation: none; left: 46%; opacity: 1; }
}
/* Фірмова плашка-настрій під логотипом */
.foot-tag {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 14px; padding: 7px 14px; border-radius: 999px;
  background: var(--glow); color: var(--accent);
  font-size: 13px; font-weight: 700;
}
.foot-tag i { font-size: 13px; }
.footer-brand { max-width: 340px; }
.footer-logo { height: 34px; margin-bottom: 14px; }
.footer-brand p { color: var(--text-muted); font-size: 14px; line-height: 1.6; }
.footer-social { display: flex; gap: 10px; margin-top: 16px; }
.footer-social a { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-muted); font-size: 16px; transition: .2s; }
.footer-social a:hover { color: #fff; background: var(--accent); border-color: var(--accent); transform: translateY(-2px); }
.footer-col h4 { font-size: 15px; font-weight: 700; margin-bottom: 14px; }
.footer-col a { display: block; color: var(--text-muted); font-size: 14px; padding: 5px 0; transition: .2s; }
.footer-col a:hover { color: var(--accent); }
.footer-bottom { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding-top: 22px; border-top: 1px solid var(--border); color: var(--text-dim); font-size: 13px; }
.footer-bottom > span:first-child { color: var(--text-dim); }
/* «powered by ksibe» — окрема плашка-бейдж, а не текст у купі з копірайтом.
   Лого інлайнове з fill=currentColor, тож достатньо задати color на плашці. */
.foot-powered {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 7px 14px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text-muted); font-size: 12.5px; font-weight: 600;
  transition: .2s;
}
.foot-powered svg {
  /* висоту задаємо в em, ширину рахує viewBox (1773×236) — знак не спотвориться */
  height: 1.15em; width: auto; display: block;
}
.foot-powered:hover { color: var(--text); border-color: var(--border-strong); }

/* ВАЖЛИВО: футер центрує вміст через .container. На сторінках із app-shell.css
   у .container зашитий великий нижній відступ (padding-bottom:100px — резерв під
   фіксовану нижню навігацію застосунку). У футері його бути НЕ повинно — інакше
   між «дорогою», колонками й копірайтом зяяли порожні ~100px. Прибираємо
   вертикальні поля контейнерів у футері й повертаємо лише потрібні. */
.footer .container { padding-top: 0; padding-bottom: 0; }
.footer .footer-grid { padding-bottom: 30px; }
.footer .footer-bottom { padding-top: 22px; }

@media (max-width: 720px){ .footer-grid { grid-template-columns: 1fr 1fr; } .footer-brand { grid-column: 1 / -1; } }
@media (max-width: 480px){
  /* На телефоні футер стакається — даємо повітря, бо інакше низ виглядав «вжатим». */
  .footer-grid { grid-template-columns: 1fr; gap: 26px; padding-bottom: 28px; text-align: center; }
  .footer-brand { max-width: none; }
  .footer-brand p { max-width: 340px; margin-inline: auto; }
  .footer-social { justify-content: center; }
  .footer-col a { padding: 8px 0; }
  .footer-bottom {
    flex-direction: column;
    gap: 10px;
    padding-top: 24px;
    text-align: center;
    line-height: 1.65;
  }
  .foot-road { margin-bottom: 30px; }
}

/* Кнопка деталей поїздки */
.trip-btn { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 16px; padding: 11px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); color: var(--accent); font-weight: 600; font-size: 14px; transition: .2s; }
.trip-btn:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

/* Модалка */
.modal-overlay { position: fixed; inset: 0; z-index: 200; display: none; align-items: center; justify-content: center; padding: 20px; background: rgba(10,9,30,.6); backdrop-filter: blur(4px); }
.modal-overlay.open { display: flex; animation: fadeDown .25s ease; }
.modal { width: 100%; max-width: 460px; background: var(--surface-solid); border: 1px solid var(--border-strong); border-radius: 22px; padding: 30px; box-shadow: var(--shadow); position: relative; max-height: 90vh; overflow-y: auto; }
.modal-close { position: absolute; top: 12px; right: 16px; border: none; background: none; color: var(--text-muted); font-size: 28px; line-height: 1; cursor: pointer; transition: .2s; }
.modal-close:hover { color: var(--accent); }
.modal-head { text-align: center; margin-bottom: 20px; }
.modal-ic { width: 54px; height: 54px; margin: 0 auto 14px; border-radius: 15px; display: grid; place-items: center; font-size: 22px; color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 10px 24px var(--glow); }
.modal-head h3 { font-size: 22px; font-weight: 800; margin-bottom: 6px; }
.modal-head p { color: var(--text-muted); font-size: 14px; }
.modal-form { display: flex; flex-direction: column; gap: 12px; }
.modal-form input, .modal-form textarea { width: 100%; padding: 13px 15px; border-radius: 13px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font-family: inherit; font-size: 15px; transition: .2s; }
.modal-form input:focus, .modal-form textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--glow); }
.modal-form textarea { resize: vertical; min-height: 110px; }
.modal-form .btn-primary { width: 100%; }
.modal-msg { font-size: 13px; color: #ff8a93; }
.modal-msg.err { padding: 10px 12px; background: rgba(230,57,70,.12); border: 1px solid rgba(230,57,70,.4); border-radius: 10px; }
.modal-alt { text-align: center; font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.modal-alt a { color: var(--accent); font-weight: 600; }
.modal-done { text-align: center; padding: 16px 0; }
.modal-done i { font-size: 48px; color: var(--success); margin-bottom: 14px; }
.modal-done h4 { font-size: 20px; font-weight: 800; margin-bottom: 6px; }
.modal-done p { color: var(--text-muted); font-size: 14px; }

/* ---- Популярні напрямки (hero) ---- */
.hero-routes { display: flex; align-items: center; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 4px; }
.hr-label { color: var(--text-dim); font-size: 14px; font-weight: 600; display: inline-flex; align-items: center; gap: 7px; }
.hr-label i { color: var(--accent); }
.route-chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  font-size: 14px; font-weight: 600; transition: .22s;
}
.route-chip i { color: var(--accent); font-size: 12px; }
.route-chip:hover { background: var(--accent); color: #fff; border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 8px 18px var(--glow); }
.route-chip:hover i { color: #fff; }

/* ---- Каталог напрямків на телефоні ----
   Кнопки «показати ще» більше нема: на телефоні просто обмежуємо каталог
   кількома картками, а повний список — за посиланням «Усі напрямки».
   Усі посилання лишаються в HTML (для пошуковика), CSS лише ховає зайві. */
@media (max-width: 560px) {
  #routesGrid > .seo-link:nth-child(n + 7) { display: none; }
}

/* ---- Статистика (3 картки) ---- */
.stats-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 620px){ .stats-3 { grid-template-columns: 1fr; } }
.stat-icon-sm { width: 44px; height: 44px; margin: 0 auto 12px; border-radius: 12px; display: grid; place-items: center; font-size: 18px; color: var(--accent); background: var(--surface-2); }

/* ---- Кастомний date-picker ---- */
/* коли календар відкрито — піднімаємо блок над наступними секціями */
.hero:has(.dp-open) { position: relative; z-index: 45; }
.dp { position: relative; }
.dp .dp-ico { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--accent); font-size: 15px; pointer-events: none; z-index: 1; }
.dp .dp-display { width: 100%; padding: 15px 14px 15px 40px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font-size: 15px; font-family: inherit; cursor: pointer; }
.dp .dp-display::placeholder { color: var(--text-dim); }
.dp.dp-open .dp-display { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--glow); }
.dp-panel { position: absolute; top: calc(100% + 8px); left: 0; z-index: 60; width: 300px; max-width: 92vw; padding: 16px; border-radius: 16px; background: var(--dp-bg); border: 1px solid var(--border-strong); box-shadow: var(--shadow); display: none; }
.dp-panel.is-open { display: block; animation: fadeDown .2s ease; }
.dp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.dp-title { font-weight: 700; font-size: 16px; color: var(--text); }
.dp-nav { width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--accent); cursor: pointer; transition: .2s; font-size: 14px; }
.dp-nav:hover { background: var(--accent); color: #fff; }
.dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.dp-wd { text-align: center; font-size: 12px; color: var(--accent); padding: 4px 0 8px; font-weight: 700; }
.dp-day { min-height: 38px; border: none; border-radius: 10px; background: transparent; color: var(--text); font-family: inherit; font-size: 15px; font-weight: 600; cursor: pointer; transition: .15s; }
.dp-day:hover:not(.dis) { background: var(--accent); color: #fff; }
.dp-day.today { box-shadow: inset 0 0 0 2px var(--accent); color: var(--accent); }
.dp-day.sel { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; font-weight: 800; box-shadow: 0 6px 14px var(--glow); }
.dp-day.dis { color: var(--text-dim); opacity: .45; cursor: default; font-weight: 500; }
.dp-foot { margin-top: 12px; text-align: center; }
.dp-clear { border: 1px solid var(--border); background: var(--surface-2); color: var(--text-muted); font-size: 13px; padding: 8px 16px; border-radius: 10px; cursor: pointer; font-family: inherit; font-weight: 600; transition: .2s; }
.dp-clear:hover { color: #fff; background: var(--accent); border-color: var(--accent); }

/* Затемнення під панеллю (лише мобільний bottom-sheet, у JS перемикається класом .show) */
.dp-scrim { display: none; position: fixed; inset: 0; z-index: 59; background: rgba(6, 6, 22, .55); }

/* Мобільний date-picker — на весь екран знизу, а не вузький попап біля поля */
@media (max-width: 560px) {
  .dp-scrim.show { display: block; animation: dpFade .2s ease; }
  .dp-panel {
    position: fixed; top: auto; left: 0; right: 0; bottom: 0;
    width: 100%; max-width: none;
    padding: 20px 18px calc(20px + env(safe-area-inset-bottom));
    border-radius: 22px 22px 0 0;
  }
  .dp-panel.is-open { animation: dpUp .28s cubic-bezier(.22, .61, .36, 1); }
  .dp-grid { gap: 6px; }
  .dp-day { min-height: 46px; font-size: 17px; }
  .dp-wd { font-size: 13px; }
}
@keyframes dpUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes dpFade { from { opacity: 0; } to { opacity: 1; } }

/* ---- Кастомний вибір часу (timepicker.js) ---- */
/* Той самий вигляд, що й у датапікера: поле-тригер + панель, що спливає. */
.tp { position: relative; }
.tp .tp-ico { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--accent); font-size: 15px; pointer-events: none; z-index: 1; }
.tp .tp-display { width: 100%; padding: 15px 14px 15px 40px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font-size: 15px; font-family: inherit; cursor: pointer; }
.tp .tp-display::placeholder { color: var(--text-dim); }
.tp.tp-open .tp-display { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--glow); }

.tp-panel { position: absolute; top: calc(100% + 8px); left: 0; z-index: 60; width: 240px; max-width: 92vw; padding: 12px; border-radius: 16px; background: var(--dp-bg); border: 1px solid var(--border-strong); box-shadow: var(--shadow); display: none; }
.tp.tp-open .tp-panel { display: block; animation: fadeDown .2s ease; }

.tp-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tp-col { display: flex; flex-direction: column; min-width: 0; }
.tp-col-head { text-align: center; font-size: 12px; font-weight: 700; color: var(--accent); padding-bottom: 8px; }
/* Колонки прокручуються, щоб панель лишалась компактною */
.tp-col-scroll { max-height: 208px; overflow-y: auto; display: flex; flex-direction: column; gap: 3px; padding-right: 4px; scrollbar-width: thin; }
.tp-cell { min-height: 36px; border: none; border-radius: 10px; background: transparent; color: var(--text); font-family: inherit; font-size: 15px; font-weight: 600; cursor: pointer; transition: .15s; }
.tp-cell:hover { background: var(--surface-2); }
.tp-cell.sel { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; font-weight: 800; box-shadow: 0 6px 14px var(--glow); }

@media (max-width: 560px) { .tp-panel { width: 220px; } }

/* ---- Як це працює (оновлено) ---- */
.steps { position: relative; }
@media (min-width: 720px){
  .steps::before {
    content: ""; position: absolute; top: 66px; left: 16%; right: 16%; height: 2px;
    background: linear-gradient(90deg, transparent, var(--border-strong), transparent); z-index: 0;
  }
}
.step { position: relative; z-index: 1; }
.step-circle {
  position: relative; width: 76px; height: 76px; margin: 0 auto 18px; border-radius: 22px;
  display: grid; place-items: center; font-size: 28px; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 12px 30px var(--glow); transition: .3s;
}
.step:hover .step-circle { transform: translateY(-6px) rotate(-4deg); }
.step-badge {
  position: absolute; top: -8px; right: -8px; width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center; font-size: 13px; font-weight: 800; color: var(--accent);
  background: var(--surface-solid); border: 2px solid var(--accent); box-shadow: var(--shadow-sm);
}

/* ---- Підтримка ---- */
.support-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; max-width: 840px; margin: 0 auto; }
@media (max-width: 640px){ .support-grid { grid-template-columns: 1fr; } }
.support-card { padding: 34px 28px; border-radius: 20px; background: var(--surface); border: 1px solid var(--border); text-align: center; transition: .3s; }
.support-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-sm); border-color: var(--border-strong); }
.support-ic { width: 62px; height: 62px; margin: 0 auto 16px; border-radius: 16px; display: grid; place-items: center; font-size: 25px; color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 10px 24px var(--glow); }
.support-ic.tg { background: linear-gradient(135deg, #2aabee, #1c8bc4); box-shadow: 0 10px 24px rgba(42,171,238,.35); }
.support-card h3 { font-size: 20px; font-weight: 700; margin-bottom: 8px; }
.support-card p { color: var(--text-muted); font-size: 15px; margin-bottom: 22px; }
.support-card .btn-primary, .support-card .btn-secondary { width: 100%; }

/* ---- Переваги (4 картки) ---- */
.features-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1000px){ .features-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px){ .features-4 { grid-template-columns: 1fr; } }

/* ---- Мобільна версія ---- */
@media (max-width: 768px) {
  .container { padding: 0 16px; }
  .nav-container { padding: 11px 16px; gap: 8px; }
  .btn-nav-login, .btn-nav-logout { padding: 8px 12px; font-size: 13px; }
  /* розмір тримаємо однаковий із .theme-toggle — інакше ряд іконок «стрибає» */
  .theme-toggle, .btn-nav-ico { width: 38px; height: 38px; }
  .btn-nav-ico { font-size: 15px; }
  .logo { height: 32px; }
  .hero { padding: 30px 0 14px; }
  .hero-badge { margin-bottom: 14px; font-size: 12px; }
  .hero-title { margin-bottom: 14px; }
  .hero-subtitle { margin-bottom: 22px; }
  .hero-search { padding: 10px; gap: 8px; border-radius: 16px; }
  section.block { padding-top: 32px; padding-bottom: 32px; }
  .section-head { margin-bottom: 22px; }
  .trips-grid, .features-grid, .features-4, .support-grid { gap: 14px; }
  .feature-card, .support-card, .trip-card { padding: 22px 20px; }
  .feature-icon, .support-ic { width: 50px; height: 50px; font-size: 20px; margin-bottom: 14px; }
  .steps { gap: 16px; }
  .step { padding: 12px; }
  .step-circle { width: 64px; height: 64px; font-size: 24px; margin-bottom: 12px; }
  .cta { padding: 34px 20px; border-radius: 20px; margin: 22px 0; }
  .footer { padding: 34px 0 40px; }
  .footer-links { gap: 12px 16px; }
}
/* Усі сітки — в одну колонку на телефоні (без розтягувань/переповнень) */
@media (max-width: 600px) {
  .stats, .stats-3, .trips-grid, .features-grid, .features-4, .steps, .support-grid { grid-template-columns: minmax(0, 1fr); }
  .trip-card, .feature-card, .support-card, .stat-card, .trips-grid > *, .features-grid > *, .support-grid > * { width: 100%; min-width: 0; }
}
@media (max-width: 440px) {
  .hero-title { font-size: 29px; }
  .hero-subtitle { font-size: 15px; }
  .nav-menu { gap: 7px; }
  .route-chip { font-size: 13px; padding: 8px 13px; }
  .hr-label { width: 100%; justify-content: center; margin-bottom: 2px; }
  .hero-buttons { flex-direction: column; }
  .hero-buttons .btn-primary, .hero-buttons .btn-secondary { width: 100%; }
  .feature-card, .support-card, .trip-card { padding: 22px 20px; }
  .step-circle { width: 66px; height: 66px; font-size: 24px; }
  .btn-nav-login, .btn-nav-logout { padding: 8px 11px; font-size: 12px; }
}

/* Доступність / рух */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}
