@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --brand: #1769e0;
  --brand-strong: #0d3f91;
  --brand-soft: #e9f2ff;
  --ink: #121826;
  --muted: #647083;
  --line: #d9e2ef;
  --surface: #ffffff;
  --surface-2: #f5f8fc;
  --success: #10845b;
  --warn: #f59f00;
  --danger: #d64545;
  --focus: #ffd84d;
  --shadow: 0 18px 50px rgba(22, 41, 72, 0.12);
  --max-width: 1180px;
  --radius: 8px;
  --font: Inter, Arial, sans-serif;
  --color-text: var(--ink);
  --color-text-secondary: var(--muted);
  --color-brand: var(--brand);
  --color-brand-hover: var(--brand-strong);
  --color-border: var(--line);
  --color-body: var(--surface);
  --color-bg: var(--surface-2);
  --color-tag-bg: var(--brand-soft);
  --color-success: var(--success);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--surface-2);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
}

a { color: var(--brand); }
img { max-width: 100%; display: block; }
button, input, select { font: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid rgba(217, 226, 239, 0.9);
  backdrop-filter: blur(18px);
}

.header-inner {
  max-width: var(--max-width);
  height: 68px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
  min-width: 0;
}

.header-logo img {
  width: 42px;
  height: 42px;
  object-fit: contain;
  border-radius: 8px;
}

.header-logo-text {
  font-weight: 800;
  font-size: 1.18rem;
  letter-spacing: 0;
}

.header-tagline {
  margin-top: -2px;
  color: var(--muted);
  font-size: 0.78rem;
  white-space: nowrap;
}

.header-nav {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  padding: 0;
}

.header-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 12px;
  border-radius: 999px;
  color: var(--ink);
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
}

.header-nav a:hover,
.header-nav a.active {
  color: var(--brand-strong);
  background: var(--brand-soft);
}

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--surface);
  cursor: pointer;
}

.hero-shell {
  position: relative;
  min-height: 510px;
  overflow: visible;
  background: #0b1830;
}

.hero-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(8, 24, 48, 0.88), rgba(8, 24, 48, 0.46) 50%, rgba(8, 24, 48, 0.18)),
    url("/static/images/banner.jpg") center/cover no-repeat;
}

.hero-inner {
  position: relative;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 58px 20px 130px;
  color: #fff;
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  font-size: 0.86rem;
  font-weight: 700;
}

.hero-title {
  max-width: 650px;
  margin: 0;
  font-size: clamp(2.25rem, 6vw, 4.5rem);
  line-height: 1.02;
  letter-spacing: 0;
}

.hero-copy {
  max-width: 560px;
  margin: 18px 0 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: 1.08rem;
}

.search-dock {
  max-width: var(--max-width);
  margin: -92px auto 0;
  padding: 0 20px;
  position: relative;
  z-index: 5;
}

.search-card,
.panel-card,
.confirmation-panel,
.contact-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.search-card {
  padding: 22px;
}

.trip-type-group,
.segmented {
  display: inline-grid;
  grid-auto-flow: column;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
}

.trip-type-btn,
.segment-btn,
.sort-btn {
  border: 0;
  border-radius: 999px;
  padding: 10px 18px;
  color: var(--muted);
  background: transparent;
  font-weight: 800;
  cursor: pointer;
}

.trip-type-btn.active,
.segment-btn.active,
.sort-btn.active {
  color: #fff;
  background: var(--brand);
  box-shadow: 0 8px 20px rgba(23, 105, 224, 0.22);
}

.search-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) 48px minmax(0, 1.1fr);
  gap: 12px;
  align-items: end;
  margin-top: 18px;
}

.search-grid.compact {
  grid-template-columns: 1.1fr 1.1fr 0.8fr 0.8fr 0.55fr 0.85fr auto;
  align-items: end;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 0.55fr 0.9fr;
  gap: 12px;
  margin-top: 12px;
}

.form-group {
  position: relative;
  margin: 0;
}

.form-label {
  display: block;
  margin-bottom: 7px;
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 800;
}

.form-hint {
  display: block;
  margin: -4px 0 7px;
  color: var(--muted);
  font-size: 0.82rem;
}

.form-input,
.form-select {
  width: 100%;
  min-height: 50px;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: #fff;
  font-weight: 700;
  transition: border-color 0.18s, box-shadow 0.18s, transform 0.18s;
}

.form-input:hover,
.form-select:hover {
  border-color: #b8c7d9;
}

.form-input:focus,
.form-select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(23, 105, 224, 0.12);
  outline: none;
}

.swap-btn,
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 50px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--brand);
  background: #fff;
  cursor: pointer;
  transition: transform 0.18s, box-shadow 0.18s;
}

.swap-btn:hover,
.icon-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(22, 41, 72, 0.12);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 20px;
  border: 0;
  border-radius: var(--radius);
  color: #fff;
  background: var(--brand);
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.18s, box-shadow 0.18s, background 0.18s;
}

.btn:hover {
  transform: translateY(-1px);
  color: #fff;
  background: var(--brand-strong);
  box-shadow: 0 14px 30px rgba(23, 105, 224, 0.24);
}

.btn-primary { background: var(--success); }
.btn-primary:hover { background: #0b6f4c; box-shadow: 0 14px 30px rgba(16, 132, 91, 0.22); }
.btn-secondary { color: var(--ink); background: #fff; border: 1px solid var(--line); }
.btn-secondary:hover { color: var(--ink); background: var(--surface-2); box-shadow: none; }
.btn-blue { background: var(--brand); }
.btn-full { width: 100%; }

.trust-row {
  max-width: var(--max-width);
  margin: 28px auto 0;
  padding: 0 20px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.trust-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.trust-card h2 {
  margin: 0 0 4px;
  font-size: 1rem;
}

.trust-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.main-wrapper {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 36px 20px 68px;
}

.page-title {
  margin: 0 0 8px;
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  line-height: 1.1;
  letter-spacing: 0;
}

.page-caption {
  margin: 0 0 24px;
  color: var(--muted);
}

.breadcrumb {
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 0.88rem;
}

.breadcrumb a { color: var(--muted); text-decoration: none; }

.results-topline {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: end;
  margin: 26px 0 18px;
}

.results-summary {
  color: var(--muted);
  font-size: 0.95rem;
}

.results-layout {
  display: grid;
  grid-template-columns: 288px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.filters-panel {
  position: sticky;
  top: 86px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 8px 24px rgba(22, 41, 72, 0.06);
}

.filters-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  font-size: 1rem;
  font-weight: 800;
}

.filter-group {
  padding: 16px 0;
  border-top: 1px solid var(--line);
}

.filter-label {
  display: block;
  margin-bottom: 10px;
  font-weight: 800;
  font-size: 0.9rem;
}

.filter-checkbox,
.radio-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 9px 0;
  color: var(--ink);
  font-size: 0.92rem;
  cursor: pointer;
}

.filter-checkbox span,
.radio-row span {
  color: var(--muted);
  font-size: 0.82rem;
}

input[type="checkbox"],
input[type="radio"] {
  accent-color: var(--brand);
  width: 18px;
  height: 18px;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--brand);
}

.filter-actions {
  display: none;
  gap: 10px;
  margin-bottom: 14px;
}

.sort-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.sort-bar .sort-btn {
  border: 1px solid var(--line);
  background: #fff;
}

.sort-bar .sort-btn.active {
  border-color: var(--brand);
  background: var(--brand);
}

.flight-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.flight-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 170px;
  gap: 18px;
  align-items: center;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 8px 24px rgba(22, 41, 72, 0.06);
  animation: liftIn 0.36s ease both;
  transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
}

.flight-card:hover {
  transform: translateY(-2px);
  border-color: #bad0ed;
  box-shadow: 0 18px 42px rgba(22, 41, 72, 0.12);
}

@keyframes liftIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.flight-main {
  display: grid;
  grid-template-columns: 142px minmax(260px, 1fr) auto;
  gap: 18px;
  align-items: center;
}

.flight-airline {
  min-width: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.airline-logo {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 6px;
  border-radius: var(--radius);
  color: var(--brand-strong);
  background: var(--brand-soft);
  font-size: 0.78rem;
  font-weight: 900;
}

.airline-logo img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.quote-overview {
  display: grid;
  gap: 14px;
  margin-top: 20px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.quote-route {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  font-size: 1.35rem;
  font-weight: 900;
}

.quote-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.quote-detail {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.quote-detail-label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.quote-detail-value {
  margin-top: 3px;
  font-weight: 800;
}

.flight-times {
  display: grid;
  grid-template-columns: 70px minmax(120px, 1fr) 70px;
  align-items: center;
  gap: 14px;
}

.flight-time {
  font-size: 1.42rem;
  line-height: 1;
  font-weight: 900;
}

.flight-airport {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.flight-duration-line {
  text-align: center;
  min-width: 0;
}

.duration-bar {
  position: relative;
  height: 2px;
  margin: 8px 0;
  background: var(--line);
}

.duration-bar::before,
.duration-bar::after {
  content: "";
  position: absolute;
  top: -4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--brand);
}

.duration-bar::before { left: 0; }
.duration-bar::after { right: 0; }

.duration-text {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.flight-stops {
  color: var(--success);
  font-size: 0.82rem;
  font-weight: 800;
}

.flight-stops.has-stop { color: var(--warn); }

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 9px;
  border-radius: 999px;
  color: var(--brand-strong);
  background: var(--brand-soft);
  font-size: 0.78rem;
  font-weight: 900;
  white-space: nowrap;
}

.tag-green {
  color: var(--success);
  background: #e6f6ef;
}

.baggage-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

.baggage-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: #fff;
  font-size: 0.78rem;
  font-weight: 800;
}

.baggage-pill.included {
  color: var(--success);
  border-color: #bde7d5;
  background: #e6f6ef;
}

.flight-price-col {
  text-align: right;
}

.flight-price {
  font-size: 1.75rem;
  line-height: 1;
  font-weight: 900;
}

.price-note {
  margin: 6px 0 12px;
  color: var(--muted);
  font-size: 0.82rem;
}

.no-results {
  padding: 44px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  text-align: center;
}

.autocomplete-list {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 80;
  max-height: 310px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
  display: none;
}

.autocomplete-list.open { display: block; }

.autocomplete-item {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}

.autocomplete-item:hover,
.autocomplete-item.active {
  background: var(--brand-soft);
}

.airport-code {
  color: var(--brand-strong);
  font-weight: 900;
}

.airport-name {
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.airport-meta {
  color: var(--muted);
  font-size: 0.82rem;
}

.spinner-overlay {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 14px;
  background: rgba(245, 248, 252, 0.86);
  backdrop-filter: blur(10px);
}

.spinner-overlay.active { display: flex; }

.spinner {
  width: 54px;
  height: 54px;
  border: 5px solid #dce8f7;
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.spinner-text {
  color: var(--ink);
  font-weight: 800;
}

.inset,
.error-summary {
  margin: 22px 0;
  padding: 16px 18px;
  border-left: 5px solid var(--brand);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--brand-soft);
}

.inset-warning {
  border-left-color: var(--warn);
  background: #fff7e6;
}

.inset-success {
  border-left-color: var(--success);
  background: #e6f6ef;
}

.confirmation-panel,
.contact-card,
.panel-card {
  padding: 28px;
}

.confirmation-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  margin-bottom: 14px;
  border-radius: 999px;
  background: var(--success);
}

.confirmation-ref {
  display: inline-flex;
  padding: 10px 16px;
  border-radius: var(--radius);
  color: var(--brand-strong);
  background: var(--brand-soft);
  font-size: 1.7rem;
  font-weight: 900;
  letter-spacing: 0;
}

.summary-list {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
}

.summary-row {
  display: grid;
  grid-template-columns: 220px 1fr;
  border-bottom: 1px solid var(--line);
}

.summary-row:last-child { border-bottom: 0; }

.summary-key,
.summary-value {
  padding: 14px 16px;
}

.summary-key {
  color: var(--muted);
  background: var(--surface-2);
  font-weight: 800;
}

.site-footer {
  margin-top: 48px;
  padding: 38px 20px 26px;
  color: rgba(255, 255, 255, 0.76);
  background: #101a2b;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.footer-top {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.footer-col-title {
  margin-bottom: 10px;
  color: #fff;
  font-weight: 900;
}

.footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-links a {
  display: inline-block;
  padding: 3px 0;
  color: rgba(255, 255, 255, 0.72);
  text-decoration: none;
}

.footer-links a:hover { color: #fff; }

.footer-bottom {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding-top: 18px;
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.86rem;
}

.footer-bottom a { color: rgba(255, 255, 255, 0.68); }

.contact-grid,
.price-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.contact-card h2 {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 0;
}

.contact-card h2 svg,
.contact-icon {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
}

.contact-detail {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.error-message {
  display: flex;
  gap: 8px;
  color: var(--danger);
  font-weight: 800;
}

@media (max-width: 980px) {
  .search-grid.compact,
  .form-grid {
    grid-template-columns: 1fr 1fr;
  }
  .results-layout {
    grid-template-columns: 1fr;
  }
  .filters-panel {
    display: none;
    position: fixed;
    inset: auto 0 0 0;
    z-index: 200;
    max-height: 84vh;
    overflow: auto;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -18px 44px rgba(10, 20, 35, 0.18);
  }
  .filters-panel.open { display: block; }
  .filter-actions { display: flex; }
  .flight-main {
    grid-template-columns: 130px minmax(220px, 1fr);
  }
  .flight-main .tag { grid-column: 1 / -1; width: fit-content; }
}

@media (max-width: 760px) {
  .header-inner { height: 64px; }
  .header-tagline { display: none; }
  .nav-toggle { display: inline-flex; }
  .header-nav {
    display: none;
    position: absolute;
    left: 12px;
    right: 12px;
    top: 72px;
    flex-direction: column;
    align-items: stretch;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    box-shadow: var(--shadow);
  }
  .header-nav.open { display: flex; }
  .header-nav a { border-radius: var(--radius); }
  .hero-shell { min-height: 470px; }
  .hero-inner { padding: 42px 18px 118px; }
  .search-dock { margin-top: -96px; padding: 0 12px; }
  .search-card { padding: 16px; }
  .search-grid,
  .search-grid.compact,
  .form-grid,
  .trust-row,
  .footer-top,
  .contact-grid,
  .price-compare {
    grid-template-columns: 1fr;
  }
  .swap-btn { width: 100%; }
  .main-wrapper { padding: 28px 12px 50px; }
  .results-topline {
    display: block;
  }
  .flight-card {
    grid-template-columns: 1fr;
  }
  .flight-main {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .flight-times {
    grid-template-columns: 64px minmax(100px, 1fr) 64px;
  }
  .flight-price-col {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    text-align: left;
    gap: 12px;
  }
  .price-note { margin-bottom: 0; }
  .summary-row { grid-template-columns: 1fr; }
  .summary-key { padding-bottom: 4px; }
  .summary-value { padding-top: 6px; }
  .quote-detail-grid { grid-template-columns: 1fr; }
  .quote-route { display: grid; }
}

@media (max-width: 430px) {
  .trip-type-group,
  .segmented {
    width: 100%;
    grid-auto-flow: initial;
    grid-template-columns: 1fr 1fr;
  }
  .flight-price-col {
    grid-template-columns: 1fr;
  }
  .btn { width: 100%; }
}
