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

:root {
  color-scheme: light;
  --bf-bg: oklch(1 0 0);
  --bf-surface: oklch(0.985 0.004 210);
  --bf-ink: oklch(0.255 0.055 252);
  --bf-muted: oklch(0.525 0.035 247);
  --bf-line: oklch(0.885 0.018 230);
  --bf-palm: oklch(0.350 0.075 110);
  --bf-ocean: oklch(0.765 0.118 202);
  --bf-coral: oklch(0.675 0.185 32);
  --bf-coral-dark: oklch(0.605 0.190 31);
  --bf-focus: oklch(0.590 0.180 250);
  --bf-danger: oklch(0.585 0.200 25);
  --bf-shadow: 0 24px 72px oklch(0.255 0.055 252 / 0.16), 0 4px 16px oklch(0.255 0.055 252 / 0.08);
  --bf-radius: 16px;
  font-family: "Onest", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { min-width: 320px; background: #e9f8fb; }

body {
  margin: 0;
  min-width: 320px;
  color: var(--bf-ink);
  background: #e9f8fb;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select { font: inherit; }

button { color: inherit; }

.skip-link {
  position: fixed;
  z-index: 100;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  color: white;
  background: var(--bf-ink);
  border-radius: 8px;
  transform: translateY(-150%);
  transition: transform 160ms ease-out;
}

.skip-link:focus { transform: translateY(0); }

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.hero-shell {
  position: relative;
  min-height: 100svh;
  overflow: hidden;
  isolation: isolate;
}

.hero-picture {
  position: absolute;
  z-index: -2;
  inset: 0;
  display: block;
}

.hero-scene {
  width: 100%;
  height: 100%;
  min-height: 760px;
  object-fit: cover;
  object-position: center center;
  display: block;
  user-select: none;
  pointer-events: none;
}

.hero-shell::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background: oklch(1 0 0 / 0.07);
  pointer-events: none;
}

.site-header {
  width: min(1480px, calc(100% - 80px));
  margin: 0 auto;
  padding-top: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--bf-ink);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.04em;
  text-decoration: none;
}

.brand-mark {
  width: 40px;
  height: 40px;
  display: block;
  flex: none;
}

.header-note {
  margin: 0;
  padding: 9px 13px;
  color: var(--bf-muted);
  background: oklch(1 0 0 / 0.76);
  border: 1px solid oklch(1 0 0 / 0.72);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
}

.hero-content {
  width: min(1440px, calc(100% - 80px));
  margin: 0 auto;
  padding: clamp(74px, 10vh, 112px) 0 48px;
}

.hero-copy {
  max-width: 760px;
  margin: 0 auto 42px;
  text-align: center;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--bf-coral-dark);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  max-width: 820px;
  margin: 0 auto;
  font-size: clamp(42px, 4.2vw, 64px);
  line-height: 1.04;
  letter-spacing: -0.05em;
  text-wrap: balance;
}

.hero-lead {
  max-width: 680px;
  margin: 18px auto 0;
  color: oklch(0.39 0.045 247);
  font-size: clamp(16px, 1.4vw, 19px);
  line-height: 1.55;
  text-wrap: balance;
}

.search-panel {
  position: relative;
  width: 100%;
  padding: 22px 26px 0;
  background: var(--bf-bg);
  border: 1px solid oklch(1 0 0 / 0.88);
  border-radius: var(--bf-radius);
  box-shadow: var(--bf-shadow);
}

.search-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.trip-type {
  display: inline-flex;
  gap: 4px;
  margin: 0;
  padding: 4px;
  background: oklch(0.955 0.008 230);
  border: 0;
  border-radius: 10px;
}

.trip-type label { position: relative; cursor: pointer; }
.trip-type input { position: absolute; opacity: 0; pointer-events: none; }
.trip-type span {
  min-height: 44px;
  display: flex;
  align-items: center;
  padding: 0 14px;
  color: var(--bf-muted);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  transition: color 160ms ease-out, background-color 160ms ease-out, box-shadow 160ms ease-out;
}
.trip-type input:checked + span {
  color: white;
  background: var(--bf-ink);
  box-shadow: 0 3px 10px oklch(0.255 0.055 252 / 0.16);
}
.trip-type input:focus-visible + span { outline: 3px solid var(--bf-focus); outline-offset: 2px; }

.flexible-note {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--bf-muted);
  font-size: 13px;
  font-weight: 500;
}
.flexible-note svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

.search-grid {
  display: grid;
  grid-template-columns: minmax(175px, 1.08fr) 48px minmax(175px, 1.08fr) minmax(245px, 1.4fr) minmax(245px, 1.4fr) minmax(160px, .86fr);
  align-items: start;
  gap: 12px;
}

#flight-search-form.is-oneway .travelers-control { grid-column: span 2; }

.control {
  position: relative;
  min-width: 0;
}

.control > label,
.control > legend,
.priority-heading label {
  display: block;
  margin: 0 0 7px;
  padding: 0;
  color: var(--bf-muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
}

.control > legend { float: left; width: 100%; }
.control > legend + * { clear: both; }

.input-shell,
.date-pair,
.travelers-trigger,
.select-control select {
  min-height: 56px;
  color: var(--bf-ink);
  background: var(--bf-bg);
  border: 1px solid var(--bf-line);
  border-radius: 10px;
  transition: border-color 150ms ease-out, box-shadow 150ms ease-out, background-color 150ms ease-out;
}

.input-shell {
  position: relative;
  display: flex;
  align-items: center;
  padding: 0 12px;
}

.input-shell > svg {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: var(--bf-muted);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.input-shell input[type="text"] {
  width: 100%;
  min-width: 0;
  height: 54px;
  padding: 0 9px;
  color: var(--bf-ink);
  background: transparent;
  border: 0;
  outline: 0;
  font-size: 15px;
  font-weight: 500;
  text-overflow: ellipsis;
}

.input-shell:focus-within,
.date-pair:focus-within,
.travelers-trigger:focus-visible,
.select-control select:focus-visible {
  border-color: var(--bf-focus);
  box-shadow: 0 0 0 3px oklch(0.59 0.18 250 / 0.17);
  outline: 0;
}

.control.is-invalid .input-shell,
.control.is-invalid .date-pair { border-color: var(--bf-danger); }

.swap-button {
  align-self: start;
  width: 48px;
  height: 54px;
  margin-top: 22.4px;
  display: grid;
  place-items: center;
  padding: 0;
  color: var(--bf-muted);
  background: transparent;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  transition: color 150ms ease-out, background-color 150ms ease-out;
}
.swap-button:hover { color: var(--bf-coral-dark); background: oklch(0.96 0.025 35); }
.swap-button:focus-visible { outline: 3px solid var(--bf-focus); outline-offset: 2px; }
.swap-button svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform 220ms ease-out; }
.swap-button.did-swap svg { transform: rotate(180deg); }

.date-control { margin: 0; padding: 0; border: 0; }
.date-control > legend { width: auto; }
.date-range-toggle {
  min-height: 15px;
  float: right;
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  margin: 0 0 6px !important;
  color: var(--bf-muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 650;
}
.date-range-toggle input { width: 15px; height: 15px; margin: 0; accent-color: var(--bf-coral-dark); }
.date-range-toggle span { line-height: 1.2; }
.date-range-toggle input:focus-visible { outline: 3px solid var(--bf-focus); outline-offset: 2px; }
.date-control > legend + .date-range-toggle { clear: none; }
.date-range-toggle + .date-pair { clear: both; }
.date-pair {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 5px;
  padding: 0 10px;
}
.date-pair:not(.is-range) { grid-template-columns: minmax(0, 1fr); }
.date-pair span { color: var(--bf-line); }
.date-pair input {
  min-width: 0;
  width: 100%;
  height: 54px;
  padding: 0 2px;
  color: var(--bf-ink);
  background: transparent;
  border: 0;
  outline: 0;
  font-size: 13px;
  font-weight: 500;
}
.date-pair input::-webkit-calendar-picker-indicator { opacity: .55; cursor: pointer; }

.travelers-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 12px;
  cursor: pointer;
}
.travelers-trigger > svg:first-child { width: 20px; height: 20px; fill: none; stroke: var(--bf-muted); stroke-width: 2; }
.travelers-trigger > span { min-width: 0; flex: 1; overflow: hidden; text-align: left; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 500; }
.chevron { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; transition: transform 180ms ease-out; }
[aria-expanded="true"] > .chevron { transform: rotate(180deg); }

.travelers-popover {
  position: absolute;
  z-index: 30;
  top: calc(100% + 9px);
  right: 0;
  width: 310px;
  padding: 8px 16px 12px;
  background: white;
  border: 1px solid var(--bf-line);
  border-radius: 12px;
  box-shadow: 0 18px 45px oklch(0.255 0.055 252 / 0.18);
}
.counter-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid oklch(0.93 0.01 230); }
.counter-row:last-of-type { border-bottom: 0; }
.counter-row strong, .counter-row small { display: block; }
.counter-row strong { font-size: 14px; }
.counter-row small { margin-top: 2px; color: var(--bf-muted); font-size: 11px; }
.stepper { display: grid; grid-template-columns: 44px 24px 44px; align-items: center; gap: 4px; text-align: center; }
.stepper button { width: 44px; height: 44px; display: grid; place-items: center; padding: 0 0 2px; color: var(--bf-ink); background: white; border: 1px solid var(--bf-line); border-radius: 50%; cursor: pointer; font-size: 20px; line-height: 1; }
.stepper button:hover { border-color: var(--bf-coral); color: var(--bf-coral-dark); }
.stepper button:focus-visible { outline: 3px solid var(--bf-focus); outline-offset: 2px; }
.stepper output { font-size: 14px; font-weight: 600; }

.field-error { min-height: 16px; margin-top: 4px; color: var(--bf-danger); font-size: 11px; line-height: 1.25; }
.travelers-popover .field-error { margin: 5px 0 0; min-height: 0; }

.suggestions {
  position: absolute;
  z-index: 40;
  top: calc(100% - 12px);
  left: 0;
  right: 0;
  max-height: 292px;
  overflow: auto;
  padding: 6px;
  background: white;
  border: 1px solid var(--bf-line);
  border-radius: 12px;
  box-shadow: 0 18px 45px oklch(0.255 0.055 252 / 0.18);
}
.suggestion {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 9px;
  width: 100%;
  padding: 10px;
  color: var(--bf-ink);
  background: transparent;
  border: 0;
  border-radius: 8px;
  text-align: left;
  cursor: pointer;
}
.suggestion:hover,
.suggestion[aria-selected="true"] { background: oklch(0.955 0.025 205); }
.suggestion-code { align-self: start; color: var(--bf-coral-dark); font-size: 13px; font-weight: 700; letter-spacing: .04em; }
.suggestion-copy { min-width: 0; }
.suggestion-copy strong, .suggestion-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suggestion-copy strong { font-size: 13px; font-weight: 600; }
.suggestion-copy small { margin-top: 2px; color: var(--bf-muted); font-size: 11px; }
.suggestions-state { padding: 14px; color: var(--bf-muted); font-size: 12px; }

.search-actions {
  min-height: 82px;
  display: grid;
  grid-template-columns: auto minmax(200px, 1fr) auto;
  align-items: center;
  gap: 22px;
  margin-top: 4px;
  border-top: 1px solid oklch(0.925 0.012 230);
}

.advanced-trigger {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  color: var(--bf-ink);
  background: transparent;
  border: 0;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
}
.advanced-trigger > svg:first-child { width: 20px; height: 20px; fill: none; stroke: var(--bf-coral-dark); stroke-width: 2; stroke-linecap: round; }
.advanced-trigger:hover { color: var(--bf-coral-dark); }
.advanced-trigger:focus-visible { outline: 3px solid var(--bf-focus); outline-offset: 4px; border-radius: 4px; }

.search-assurance { margin: 0; color: var(--bf-muted); font-size: 11px; line-height: 1.4; text-align: center; }

.search-button {
  min-width: 180px;
  height: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 24px;
  color: white;
  background: var(--bf-coral);
  border: 0;
  border-radius: 10px;
  box-shadow: 0 10px 24px oklch(0.675 0.185 32 / .25);
  cursor: pointer;
  font-size: 15px;
  font-weight: 700;
  transition: background-color 150ms ease-out, box-shadow 150ms ease-out;
}
.search-button:hover { background: var(--bf-coral-dark); box-shadow: 0 12px 28px oklch(0.675 0.185 32 / .32); }
.search-button:focus-visible { outline: 3px solid var(--bf-focus); outline-offset: 3px; }
.search-button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

.advanced-settings {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  margin: 0 -26px;
  padding: 0 26px;
  background: var(--bf-surface);
  border-radius: 0 0 var(--bf-radius) var(--bf-radius);
  transition: grid-template-rows 210ms ease-out, opacity 170ms ease-out, padding 210ms ease-out;
}
.advanced-settings.is-open { grid-template-rows: 1fr; opacity: 1; padding-top: 20px; padding-bottom: 22px; }
.advanced-inner { min-height: 0; overflow: hidden; display: grid; grid-template-columns: minmax(220px, .55fr) minmax(420px, 1.45fr); gap: 30px; }
.priority-control { min-width: 0; margin: 0; padding: 0; border: 0; }
.select-control select { width: 100%; padding: 0 46px 0 14px; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23576a7c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 18px center; background-size: 16px; }
.balance-segments { min-height: 60px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 4px; background: white; border: 1px solid var(--bf-line); border-radius: 10px; }
.balance-segments label { position: relative; min-width: 0; }
.balance-segments input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.balance-segments span { min-height: 50px; display: grid; place-items: center; padding: 0 10px; color: var(--bf-muted); border-radius: 7px; font-size: 12px; font-weight: 650; cursor: pointer; }
.balance-segments input:checked + span { color: var(--bf-ink); background: var(--bf-surface); box-shadow: inset 0 0 0 1px var(--bf-line); }
.balance-segments input:focus-visible + span { outline: 3px solid var(--bf-focus); outline-offset: 2px; }

.form-error { min-height: 0; color: var(--bf-danger); font-size: 12px; font-weight: 600; text-align: right; }
.form-error:not(:empty) { min-height: 24px; padding: 2px 0 8px; }

[hidden] { display: none !important; }

@media (max-width: 1260px) {
  .site-header, .hero-content { width: min(1180px, calc(100% - 56px)); }
  .hero-content { padding-top: 64px; }
  .search-grid { grid-template-columns: minmax(180px, 1fr) 48px minmax(180px, 1fr) minmax(230px, 1.15fr) minmax(230px, 1.15fr); }
  .travelers-control { grid-column: 5; }
  #flight-search-form.is-oneway .travelers-control { grid-column: 4 / span 2; }
  .date-control[data-date-group="return"] { grid-column: 4; }
}

@media (max-width: 980px) {
  .hero-shell { overflow-y: auto; }
  .hero-scene { height: 100%; min-height: 1020px; object-position: 46% center; }
  .hero-content { padding-top: 58px; padding-bottom: 70px; }
  .hero-copy { margin-bottom: 32px; }
  .search-grid { grid-template-columns: minmax(0, 1fr) 48px minmax(0, 1fr); }
  .date-control[data-date-group="departure"] { grid-column: 1 / span 2; margin-top: 4px; }
  .date-control[data-date-group="return"] { grid-column: 3; margin-top: 4px; }
  .travelers-control { grid-column: 1 / span 2; margin-top: 4px; }
  #flight-search-form.is-oneway .travelers-control { grid-column: 3; }
  .search-actions { grid-template-columns: auto 1fr auto; }
  .search-assurance { text-align: left; }
}

@media (max-width: 720px) {
  .site-header, .hero-content { width: calc(100% - 32px); }
  .site-header { padding-top: 18px; }
  .header-note { display: none; }
  .brand { font-size: 22px; }
  .brand-mark { width: 34px; height: 34px; }
  .hero-content { padding-top: 42px; }
  .hero-copy { text-align: left; margin-bottom: 26px; }
  .eyebrow { max-width: 310px; font-size: 11px; line-height: 1.5; }
  h1 { margin: 0; font-size: clamp(37px, 11vw, 50px); }
  .hero-lead { margin-left: 0; font-size: 15px; }
  .search-panel { padding: 18px 16px 0; border-radius: 14px; }
  .search-toolbar { align-items: flex-start; flex-direction: column; margin-bottom: 16px; }
  .flexible-note { display: none; }
  .search-grid { grid-template-columns: 1fr; gap: 2px; }
  .hero-scene { object-position: center top; }
  .swap-button { grid-column: 1; justify-self: end; width: 48px; height: 48px; margin: -5px 8px -5px 0; background: white; border: 1px solid var(--bf-line); border-radius: 50%; }
  .date-control[data-date-group="departure"],
  .date-control[data-date-group="return"],
  .travelers-control { grid-column: 1; margin-top: 5px; }
  #flight-search-form.is-oneway .travelers-control { grid-column: 1; }
  .date-pair input { font-size: 12px; }
  .travelers-popover { position: fixed; top: auto; right: 16px; bottom: 16px; left: 16px; width: auto; }
  .search-actions { grid-template-columns: 1fr; gap: 9px; padding: 16px 0 18px; }
  .advanced-trigger { justify-self: start; }
  .search-assurance { display: none; }
  .search-button { width: 100%; }
  .advanced-settings { margin: 0 -16px; padding-right: 16px; padding-left: 16px; }
  .advanced-inner { grid-template-columns: 1fr; gap: 18px; }
  .priority-range { grid-template-columns: auto minmax(100px, 1fr) auto; padding: 0 12px; }
  .form-error { text-align: left; }
}

@media (max-width: 380px) {
  .site-header, .hero-content { width: calc(100% - 24px); }
  .trip-type { width: 100%; }
  .trip-type label { flex: 1; text-align: center; }
  .trip-type span { padding-right: 8px; padding-left: 8px; font-size: 12px; }
  .date-pair { padding: 0 7px; gap: 2px; }
  .date-pair input { font-size: 11px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}
