:root {
  --bg: #e7f3fb;
  --bg-2: #d5ebf8;
  --ink: #0b2540;
  --muted: #4d6d86;
  --paper: #f7fbff;
  --line: #c5e0f2;
  --accent: #0ea5e9;
  --accent-dark: #0284c7;
  --pine: #0b4f7a;
  --pine-2: #0369a1;
  --gold: #38bdf8;
  --danger: #be123c;
  --ok: #0f766e;
  --shadow: 0 20px 50px rgba(8, 47, 73, 0.1);
  --radius: 24px;
  --font: "Manrope", system-ui, sans-serif;
  --display: "Geologica", "Manrope", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1100px 520px at 8% -12%, #bce6ff 0%, transparent 55%),
    radial-gradient(900px 420px at 108% 0%, #7dd3fc 0%, transparent 48%),
    radial-gradient(700px 380px at 50% 110%, #bae6fd 0%, transparent 50%),
    var(--bg);
  line-height: 1.5;
}

img {
  max-width: 100%;
}

a {
  color: var(--accent-dark);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

h1,
h2,
h3 {
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin: 0 0 0.4em;
}

h1 {
  font-size: clamp(2rem, 4vw, 3.4rem);
}

h2 {
  font-size: 1.7rem;
  margin-top: 1.6rem;
}

p {
  margin: 0 0 0.8em;
}

.grain {
  pointer-events: none;
  position: fixed;
  inset: 0;
  opacity: 0.12;
  z-index: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='.35'/%3E%3C/svg%3E");
}

.topbar,
main,
.site-footer,
.toasts {
  position: relative;
  z-index: 1;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 6vw;
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(18px);
  background: rgba(247, 251, 255, 0.72);
  border-bottom: 1px solid rgba(14, 165, 233, 0.14);
}

.brand,
.nav,
.nav-user {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.brand {
  font-family: var(--display);
  font-size: 1.05rem;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
}

.nav {
  gap: 1.15rem;
  font-weight: 600;
}

.nav a {
  color: var(--ink);
  text-decoration: none;
}

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

.avatar {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  background: linear-gradient(145deg, #38bdf8, #0369a1);
  color: #f0f9ff;
  display: inline-grid;
  place-items: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}

.avatar.sm {
  width: 1.7rem;
  height: 1.7rem;
  font-size: 0.62rem;
}

.inline-form {
  display: inline;
  margin: 0;
}

.link-btn {
  background: none;
  border: 0;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  color: var(--muted);
}

.menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 12px;
}

.menu-toggle span {
  display: block;
  height: 2px;
  margin: 6px 10px;
  background: var(--ink);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: 0;
  border-radius: 999px;
  padding: 0.85rem 1.25rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

.btn-accent {
  background: linear-gradient(180deg, #38bdf8, #0284c7);
  color: #f0f9ff;
  box-shadow: 0 10px 24px rgba(2, 132, 199, 0.28);
}

.btn-accent:hover {
  background: var(--accent-dark);
}

.btn-dark {
  background: var(--pine);
  color: #f0f9ff;
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
  box-shadow: inset 0 0 0 1.5px var(--line);
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-sm {
  padding: 0.55rem 0.95rem;
  font-size: 0.92rem;
}

.btn-block {
  width: 100%;
}

.btn-row {
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

main {
  min-height: calc(100vh - 180px);
}

.hero,
.page,
.page-narrow,
.section,
.auth-layout,
.site-footer {
  padding: 1.5rem 6vw 3rem;
}

.hero {
  display: grid;
  grid-template-columns: 1.3fr 0.9fr;
  gap: 2.5rem;
  align-items: center;
  padding-top: 2.2rem;
}

.hero-solo {
  grid-template-columns: 1fr;
  text-align: center;
  position: relative;
  padding: 4.2rem 6vw 3.2rem;
  overflow: hidden;
}

.hero-solo .hero-copy {
  max-width: 44rem;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.hero-solo .lede {
  margin-left: auto;
  margin-right: auto;
}

.hero-solo .hero-actions {
  justify-content: center;
}

.hero-orbs {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(280px 280px at 18% 30%, rgba(56, 189, 248, 0.35), transparent 70%),
    radial-gradient(240px 240px at 82% 20%, rgba(14, 165, 233, 0.28), transparent 70%),
    radial-gradient(200px 200px at 70% 80%, rgba(125, 211, 252, 0.4), transparent 70%);
}

.eyebrow,
.hero-card-kicker,
.footer-label {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent-dark);
  margin-bottom: 0.6rem;
}

.lede {
  font-size: 1.12rem;
  color: var(--muted);
  max-width: 38rem;
}

.search-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  background: var(--paper);
  padding: 0.55rem;
  border-radius: 18px;
  box-shadow: var(--shadow);
  margin: 1.4rem 0 1rem;
}

.search-bar .field-control {
  flex: 1;
  min-width: 8rem;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.search-sep {
  color: var(--muted);
  font-weight: 700;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}

.text-link {
  font-weight: 700;
  color: var(--pine);
}

.hero-card,
.panel {
  background: var(--paper);
  border-radius: var(--radius);
  padding: 1.4rem 1.5rem;
  box-shadow: var(--shadow);
  border: 1px solid rgba(14, 165, 233, 0.1);
}

.hero-card-sum,
.stat,
.price {
  font-family: var(--display);
  font-size: 2.2rem;
  margin: 0;
}

.price small {
  font-size: 1rem;
}

.price.sm {
  font-size: 1.3rem;
}

.muted,
.hint,
.fine,
.price-hint {
  color: var(--muted);
}

.fine {
  font-size: 0.85rem;
}

.split-bar {
  display: flex;
  height: 10px;
  border-radius: 99px;
  overflow: hidden;
  margin: 1rem 0;
  background: var(--bg-2);
}

.split-driver {
  background: var(--pine);
}

.split-fee {
  background: var(--accent);
}

.split-legend {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
}

.split-legend li {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.35rem;
}

.swatch {
  width: 10px;
  height: 10px;
  border-radius: 99px;
}

.swatch.driver {
  background: var(--pine);
}

.swatch.fee {
  background: var(--accent);
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1rem;
  margin-bottom: 1.2rem;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.steps article,
.stats article {
  background: var(--paper);
  border-radius: 18px;
  padding: 1.2rem;
  box-shadow: var(--shadow);
  border: 1px solid rgba(14, 165, 233, 0.1);
}

.step-num {
  font-family: var(--display);
  color: var(--accent);
}

.ticket-list {
  display: grid;
  gap: 1rem;
}

.ticket {
  display: grid;
  grid-template-columns: 1fr 180px;
  background: var(--paper);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid rgba(14, 165, 233, 0.12);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.ticket:hover {
  transform: translateY(-2px);
  box-shadow: 0 24px 50px rgba(8, 47, 73, 0.14);
}

.ticket.is-full {
  opacity: 0.72;
}

.ticket-main,
.ticket-stub {
  padding: 1.2rem 1.4rem;
}

.ticket-stub {
  background: linear-gradient(180deg, #0284c7, #0b4f7a);
  color: #f0f9ff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  position: relative;
}

.ticket-stub::before,
.ticket-stub::after {
  content: "";
  position: absolute;
  left: -10px;
  width: 20px;
  height: 20px;
  background: var(--bg);
  border-radius: 50%;
}

.ticket-stub::before {
  top: -10px;
}

.ticket-stub::after {
  bottom: -10px;
}

.ticket-stub .price-hint,
.ticket-stub .muted {
  color: #bae6fd;
}

.ticket-stub .btn-dark {
  background: rgba(240, 249, 255, 0.16);
  color: #f0f9ff;
  box-shadow: inset 0 0 0 1px rgba(240, 249, 255, 0.28);
}

.ticket-meta {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  color: var(--muted);
  font-size: 0.92rem;
  margin: 0 0 0.8rem;
}

.dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold);
}

.route {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0.8rem;
  align-items: center;
  margin-bottom: 1rem;
}

.route.lg {
  margin: 1.2rem 0 1.5rem;
}

.city {
  font-family: var(--display);
  font-size: 1.25rem;
  display: block;
}

.route.lg .city {
  font-size: 2rem;
}

.route-to {
  text-align: right;
}

.hint {
  font-size: 0.78rem;
}

.route-line {
  min-width: 70px;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.pin {
  width: 10px;
  height: 10px;
  border: 2px solid var(--accent);
  border-radius: 50%;
}

.pin-end {
  background: var(--accent);
}

.rail {
  flex: 1;
  height: 2px;
  background: repeating-linear-gradient(90deg, var(--ink) 0 8px, transparent 8px 14px);
  opacity: 0.35;
}

.driver-row,
.people li,
.booking-row,
.nav-user {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.seats-pill {
  margin-left: auto;
  background: #e0f2fe;
  color: var(--pine);
  border-radius: 999px;
  padding: 0.2rem 0.65rem;
  font-size: 0.82rem;
  font-weight: 700;
}

.split-page {
  display: grid;
  grid-template-columns: 1.5fr 0.85fr;
  gap: 1.2rem;
  align-items: start;
}

.sticky-panel {
  position: sticky;
  top: 5rem;
}

.facts {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.8rem 1rem;
  margin: 0 0 1.2rem;
}

.facts dt {
  color: var(--muted);
  font-size: 0.82rem;
}

.facts dd {
  margin: 0;
  font-weight: 700;
}

.comment {
  background: var(--bg);
  border-radius: 14px;
  padding: 0.9rem 1rem;
}

.driver-card {
  display: flex;
  gap: 0.9rem;
  margin: 1.2rem 0;
}

.people {
  list-style: none;
  padding: 0;
}

.people li {
  margin-bottom: 0.5rem;
}

.stack {
  display: grid;
  gap: 0.9rem;
}

.field {
  display: grid;
  gap: 0.35rem;
  font-weight: 600;
  font-size: 0.92rem;
}

.field-control,
input,
select,
textarea {
  font: inherit;
  color: var(--ink);
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 0.75rem 0.85rem;
  width: 100%;
}

.field-control:focus,
input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(14, 165, 233, 0.35);
  border-color: var(--accent);
}

.errorlist {
  color: var(--danger);
  list-style: none;
  padding: 0;
  margin: 0.2rem 0 0;
  font-size: 0.85rem;
  font-weight: 500;
}

.form-error {
  background: #ffe4e6;
  color: var(--danger);
  padding: 0.7rem 0.9rem;
  border-radius: 12px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem;
}

.form-grid.two {
  grid-template-columns: 1fr 1fr;
}

.span-2 {
  grid-column: span 2;
}

.auth-layout {
  display: grid;
  grid-template-columns: 1fr 0.85fr;
  gap: 2rem;
  align-items: stretch;
  min-height: 70vh;
}

.auth-panel {
  background: var(--paper);
  padding: 2rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  max-width: 520px;
  border: 1px solid rgba(14, 165, 233, 0.1);
}

.auth-panel.wide {
  max-width: 760px;
}

.auth-aside {
  background: linear-gradient(165deg, #0369a1, #0b2540);
  color: #e0f2fe;
  border-radius: var(--radius);
  padding: 2.4rem;
  display: flex;
  flex-direction: column;
  justify-content: end;
}

.auth-aside blockquote {
  font-family: var(--display);
  font-size: 1.5rem;
  line-height: 1.3;
  margin: 0 0 1rem;
}

.role-pick {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
}

.role-card {
  border: 1.5px solid var(--line);
  border-radius: 16px;
  padding: 0.9rem;
  cursor: pointer;
  display: grid;
  gap: 0.2rem;
}

.role-card small {
  font-weight: 500;
  color: var(--muted);
}

.role-card:has(input:checked) {
  border-color: var(--accent);
  background: #e0f2fe;
}

.role-card input {
  width: auto;
}

.driver-only {
  display: none;
}

body.show-driver-fields .driver-only {
  display: grid;
}

.booking-row {
  justify-content: space-between;
}

.booking-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.receipt {
  list-style: none;
  padding: 0;
  margin: 1rem 0;
}

.receipt li {
  display: flex;
  justify-content: space-between;
  padding: 0.55rem 0;
  border-bottom: 1px dashed var(--line);
}

.receipt .total {
  font-weight: 800;
  font-size: 1.1rem;
  border-bottom: 0;
}

.yookassa-box {
  min-height: 240px;
  margin-top: 0.8rem;
}

.hold-timer {
  background: linear-gradient(135deg, #e0f2fe, #f0f9ff);
  border: 1px solid rgba(14, 165, 233, 0.28);
  border-radius: 18px;
  padding: 1.1rem 1.2rem;
  margin: 1rem 0 1.4rem;
  text-align: center;
}

.hold-timer-compact {
  margin: 0 0 1rem;
  padding: 0.85rem 1rem;
}

.hold-kicker {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent-dark);
  margin-bottom: 0.25rem;
}

.hold-clock {
  font-family: var(--display);
  font-size: clamp(2rem, 4vw, 2.8rem);
  letter-spacing: 0.06em;
  color: var(--pine);
  margin: 0.1rem 0 0.35rem;
  font-variant-numeric: tabular-nums;
}

.hold-timer-compact .hold-clock {
  font-size: 1.7rem;
}

.hold-inline {
  color: var(--accent-dark);
  font-weight: 700;
  margin: 0.35rem 0 0;
  font-variant-numeric: tabular-nums;
}

.stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin: 1rem 0;
}

.toasts {
  padding: 0 6vw;
  display: grid;
  gap: 0.5rem;
}

.toast {
  background: var(--pine);
  color: #f0f9ff;
  padding: 0.8rem 1rem;
  border-radius: 14px;
}

.toast-error,
.toast-errorlist {
  background: var(--danger);
}

.toast-success {
  background: var(--ok);
}

.empty {
  background: var(--paper);
  padding: 1.4rem;
  border-radius: 16px;
  border: 1px solid rgba(14, 165, 233, 0.1);
}

.pager {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-top: 1.5rem;
}

.center {
  text-align: center;
}

.page-narrow {
  max-width: 780px;
  margin: 0 auto;
}

.site-footer {
  color: var(--muted);
  padding-bottom: 2rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1.2fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.brand-mini {
  font-family: var(--display);
  color: var(--ink);
}

.footer-grid a,
.copy {
  display: block;
}

code {
  background: var(--bg-2);
  padding: 0.1rem 0.35rem;
  border-radius: 6px;
  font-size: 0.9em;
}

@media (max-width: 900px) {
  .hero,
  .split-page,
  .auth-layout,
  .steps,
  .stats,
  .form-grid,
  .role-pick,
  .footer-grid,
  .ticket {
    grid-template-columns: 1fr;
  }

  .ticket-stub {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .ticket-stub::before,
  .ticket-stub::after {
    display: none;
  }

  .auth-aside {
    display: none;
  }

  .menu-toggle {
    display: block;
  }

  .nav {
    display: none;
    position: absolute;
    top: 72px;
    right: 6vw;
    left: 6vw;
    background: var(--paper);
    border-radius: 18px;
    padding: 1rem;
    flex-direction: column;
    align-items: flex-start;
    box-shadow: var(--shadow);
  }

  .nav.open {
    display: flex;
  }

  .span-2 {
    grid-column: auto;
  }
}
