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

:root {
  --blue:    #2563eb;
  --blue-dk: #1d4ed8;
  --navy:    #0f172a;
  --slate:   #1e293b;
  --muted:   #64748b;
  --border:  #e2e8f0;
  --bg:      #f1f5f9;
  --card:    #ffffff;
  --green:   #059669;
  --red:     #dc2626;
  --radius:  12px;
  --shadow:  0 1px 3px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.06);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--slate);
  min-height: 100vh;
  line-height: 1.5;
}

/* ── Nav ── */
nav {
  background: var(--navy);
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.nav-logo { color: #fff; font-weight: 700; font-size: 1.1rem; letter-spacing: -.3px; text-decoration: none; }
.nav-logo span { color: var(--blue); }
.nav-back {
  color: #94a3b8;
  text-decoration: none;
  font-size: .875rem;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color .15s;
}
.nav-back:hover { color: #fff; }
.nav-sep { color: #334155; }
.lang-toggle {
  margin-left: auto;
  background: transparent;
  border: 1px solid #334155;
  color: #94a3b8;
  font-size: .75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: border-color .15s, color .15s;
}
.lang-toggle:hover { border-color: #64748b; color: #fff; }

/* ── Hero ── */
.hero {
  background: linear-gradient(135deg, var(--navy) 0%, #1e3a5f 100%);
  padding: 56px 24px 64px;
  text-align: center;
  color: #fff;
}
.hero h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); font-weight: 700; margin-bottom: 8px; }
.hero p  { color: #94a3b8; font-size: 1rem; }

/* ── Container ── */
.container { max-width: 720px; margin: 0 auto; padding: 0 20px; }
.container-lg { max-width: 960px; margin: 0 auto; padding: 0 20px; }

/* ── Search card ── */
.search-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
  margin-top: -32px;
  position: relative;
}

/* ── Form ── */
.form-grid { display: grid; gap: 16px; }
.form-row  { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 520px) { .form-row { grid-template-columns: 1fr; } }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: .8rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.field input, .field select {
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: .95rem;
  color: var(--slate);
  background: #fff;
  transition: border-color .15s;
  outline: none;
  width: 100%;
}
.field input:focus, .field select:focus { border-color: var(--blue); }
.field input::placeholder { color: #cbd5e1; }

/* ── Button ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 8px;
  border: none;
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, transform .1s;
  text-decoration: none;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--blue); color: #fff; width: 100%; margin-top: 8px; padding: 14px; }
.btn-primary:hover { background: var(--blue-dk); }
.btn-primary:disabled { background: #93c5fd; cursor: not-allowed; transform: none; }
.btn-outline { background: transparent; color: var(--blue); border: 1.5px solid var(--blue); }
.btn-outline:hover { background: #eff6ff; }

/* ── Section header ── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px 0 16px;
}
.section-header h2 { font-size: 1.15rem; font-weight: 700; }
.section-header p  { font-size: .875rem; color: var(--muted); }

/* ── Offer cards ── */
.offers-list { display: flex; flex-direction: column; gap: 12px; padding-bottom: 40px; }

.offer-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 24px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 16px;
  border: 1.5px solid transparent;
  transition: border-color .15s, box-shadow .15s;
}
.offer-card:hover { border-color: var(--blue); box-shadow: 0 4px 20px rgba(37,99,235,.12); }

.offer-airline { font-weight: 700; font-size: 1rem; margin-bottom: 10px; }
.offer-segments { display: flex; flex-direction: column; gap: 6px; }

.segment {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: .875rem;
}
.seg-iata { font-weight: 700; font-size: 1rem; min-width: 36px; }
.seg-arrow { color: var(--muted); flex-shrink: 0; }
.seg-times { color: var(--muted); font-size: .8rem; }
.seg-flight { color: var(--muted); font-size: .78rem; margin-left: auto; }

.offer-meta { display: flex; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.tag {
  background: #f1f5f9;
  color: var(--muted);
  font-size: .75rem;
  padding: 3px 8px;
  border-radius: 4px;
  font-weight: 500;
}
.tag-stop { background: #fef3c7; color: #92400e; }

.offer-price-block { text-align: right; }
.offer-price { font-size: 1.5rem; font-weight: 800; color: var(--slate); white-space: nowrap; }
.offer-currency { font-size: .8rem; color: var(--muted); }
.offer-expires { font-size: .72rem; color: var(--muted); margin-top: 4px; }

/* ── Booking layout ── */
.booking-layout { display: grid; grid-template-columns: 1fr 340px; gap: 20px; padding-bottom: 40px; }
@media (max-width: 720px) { .booking-layout { grid-template-columns: 1fr; } }

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}
.card h3 { font-size: 1rem; font-weight: 700; margin-bottom: 18px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }

/* ── Flight summary ── */
.summary-route { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.summary-iata  { font-size: 1.5rem; font-weight: 800; }
.summary-arrow { color: var(--muted); font-size: 1.2rem; }
.summary-info  { display: flex; flex-direction: column; gap: 4px; }
.summary-info span { font-size: .85rem; color: var(--muted); }
.summary-price-row { display: flex; justify-content: space-between; align-items: center; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.summary-price-row span { font-size: .875rem; color: var(--muted); }
.summary-total { font-size: 1.35rem; font-weight: 800; }

/* ── Confirmation ── */
.confirm-hero {
  background: linear-gradient(135deg, #064e3b, #065f46);
  color: #fff;
  border-radius: var(--radius);
  padding: 36px 28px;
  text-align: center;
  margin-bottom: 20px;
}
.confirm-icon { font-size: 3rem; margin-bottom: 10px; }
.confirm-ref  { font-size: 2.5rem; font-weight: 900; letter-spacing: 4px; color: #6ee7b7; margin: 8px 0; }
.confirm-hero p { color: #a7f3d0; font-size: .9rem; }

.detail-row { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: .9rem; }
.detail-row:last-child { border-bottom: none; }
.detail-row span:first-child { color: var(--muted); }
.detail-row span:last-child  { font-weight: 600; }

/* ── States ── */
.loading-state, .empty-state, .error-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}
.loading-state .spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  margin: 0 auto 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.empty-state .icon { font-size: 2.5rem; margin-bottom: 12px; }
.error-banner {
  background: #fef2f2;
  color: var(--red);
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: .875rem;
  margin-top: 12px;
  display: none;
}
.error-banner.show { display: block; }

/* ── Sort bar ── */
.sort-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
  padding: 12px 16px;
  background: #fff;
  border-radius: 10px;
  box-shadow: var(--shadow);
}
.sort-label {
  font-size: .8rem;
  font-weight: 600;
  color: var(--muted);
  margin-right: 4px;
  white-space: nowrap;
}
.sort-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 14px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: #fff;
  color: var(--muted);
  font-size: .8rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
  white-space: nowrap;
}
.sort-btn:hover { border-color: var(--blue); color: var(--blue); }
.sort-btn.active {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
  font-weight: 600;
}
.sort-arrow { font-size: .75rem; }
.slice-divider {
  height: 1px;
  background: var(--border);
  margin: 8px 0;
}
.tag-dur {
  background: #f1f5f9;
  color: var(--muted);
  border: 1px solid var(--border);
}

/* ── Trip type toggle ── */
.trip-toggle {
  display: flex;
  background: var(--bg);
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
  width: fit-content;
}
.trip-option {
  display: flex;
  align-items: center;
  cursor: pointer;
}
.trip-option input[type="radio"] { display: none; }
.trip-option span {
  padding: 6px 18px;
  border-radius: 6px;
  font-size: .85rem;
  font-weight: 500;
  color: var(--muted);
  transition: background .15s, color .15s;
  user-select: none;
}
.trip-option input[type="radio"]:checked + span {
  background: #fff;
  color: var(--slate);
  box-shadow: 0 1px 3px rgba(0,0,0,.1);
}

/* ── Airport autocomplete ── */
.airport-wrap { position: relative; }
.airport-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  z-index: 100;
  overflow: hidden;
}
.airport-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  cursor: pointer;
  transition: background .1s;
}
.airport-option:hover,
.airport-option.active { background: #f1f5f9; }
.airport-badge {
  flex-shrink: 0;
  background: var(--blue);
  color: #fff;
  font-size: .72rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: .04em;
}
.airport-info { display: flex; flex-direction: column; min-width: 0; }
.airport-city { font-size: .875rem; font-weight: 600; color: var(--slate); }
.airport-name { font-size: .75rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── Misc ── */
.expires-badge { font-size: .72rem; color: #b45309; background: #fef3c7; padding: 2px 7px; border-radius: 4px; }
