:root {
  color-scheme: light;
  --ink: #19231f;
  --muted: #65706b;
  --faint: #8b948f;
  --line: #e1e5df;
  --paper: #f7f6f0;
  --surface: #fffdf8;
  --field: #f1f1ea;
  --forest: #214538;
  --accent: #b84b2d;
  --ok: #2d6a4f;
  --warning: #955b2d;
  --radius: 8px;
  --max: 1120px;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  min-height: 68px;
  padding: 12px max(20px, calc((100vw - var(--max)) / 2));
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.brand,
.nav-links {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
  font-weight: 780;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: var(--surface);
  background: var(--forest);
  border-radius: 50%;
  font-size: 0.76rem;
}

.nav-links {
  gap: 22px;
  color: var(--muted);
  font-size: 0.92rem;
}

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

.top-action {
  justify-self: end;
  padding: 10px 14px;
  color: var(--surface);
  background: var(--forest);
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 740;
}

main {
  width: min(var(--max), calc(100% - 40px));
  margin: 0 auto;
}

.test-mode-banner {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 18px;
  padding: 12px 14px;
  color: var(--warning);
  background: color-mix(in srgb, var(--surface) 72%, #f4dcc5);
  border: 1px solid color-mix(in srgb, var(--warning) 28%, var(--line));
  border-radius: var(--radius);
  font-size: 0.9rem;
  line-height: 1.4;
}

.test-mode-banner strong {
  color: var(--ink);
  white-space: nowrap;
}

.hero-section {
  display: grid;
  grid-template-columns: minmax(280px, 0.92fr) minmax(360px, 470px);
  gap: clamp(32px, 7vw, 84px);
  align-items: start;
  padding: clamp(48px, 9vw, 110px) 0 clamp(34px, 7vw, 84px);
}

.hero-copy {
  padding-top: clamp(4px, 4vw, 42px);
}

.eyebrow {
  margin-bottom: 12px;
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 780;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  max-width: 12ch;
  margin-bottom: 22px;
  font-family: ui-serif, Georgia, Cambria, "Times New Roman", serif;
  font-size: clamp(2.8rem, 7vw, 6.8rem);
  line-height: 0.9;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-family: ui-serif, Georgia, Cambria, "Times New Roman", serif;
  font-size: clamp(1.9rem, 3vw, 2.8rem);
  line-height: 1;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 5px;
  font-size: 1rem;
}

.lede {
  max-width: 58ch;
  margin-bottom: 28px;
  color: #3d4944;
  font-size: 1.08rem;
  line-height: 1.65;
}

.trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.trust-row span,
.document-state {
  padding: 8px 10px;
  color: var(--forest);
  background: color-mix(in srgb, var(--surface) 72%, #dce6dd);
  border: 1px solid color-mix(in srgb, var(--forest) 15%, var(--line));
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 760;
}

.planner-panel,
.document-panel,
.pricing-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.planner-panel {
  padding: clamp(20px, 3vw, 28px);
  box-shadow: 0 20px 60px rgb(45 58 52 / 10%);
}

.panel-heading {
  margin-bottom: 22px;
}

.panel-heading.horizontal {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: start;
}

.reservation-form {
  display: grid;
  gap: 15px;
}

.trip-type-control {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.trip-type-control legend,
.multi-city-heading span {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 780;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.trip-type-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 5px;
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.trip-type-options label {
  position: relative;
  display: block;
}

.trip-type-options input {
  position: absolute;
  inset: 0;
  min-height: 0;
  opacity: 0;
}

.trip-type-options span {
  display: grid;
  min-height: 38px;
  place-items: center;
  color: var(--muted);
  background: transparent;
  border-radius: 6px;
  font-size: 0.86rem;
  font-weight: 780;
  letter-spacing: 0;
  text-transform: none;
}

.trip-type-options input:checked + span {
  color: var(--forest);
  background: var(--surface);
  box-shadow: 0 1px 4px rgb(31 43 38 / 8%);
}

.route-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

label {
  display: grid;
  gap: 7px;
}

label span {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 780;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

input,
select {
  width: 100%;
  min-height: 48px;
  padding: 11px 12px;
  color: var(--ink);
  background: var(--field);
  border: 1px solid transparent;
  border-radius: var(--radius);
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--forest);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--forest) 16%, transparent);
}

.airport-field {
  position: relative;
}

.airport-suggestions {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  left: 0;
  z-index: 40;
  display: none;
  max-height: 270px;
  overflow: auto;
  padding: 6px;
  background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--forest) 24%, var(--line));
  border-radius: var(--radius);
  box-shadow: 0 18px 42px rgb(31 43 38 / 16%);
}

.airport-suggestion {
  display: grid;
  width: 100%;
  gap: 3px;
  padding: 10px;
  color: var(--ink);
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 6px;
}

.airport-suggestion:hover,
.airport-suggestion:focus {
  background: var(--field);
  outline: none;
}

.airport-suggestion strong {
  font-size: 0.9rem;
}

.airport-suggestion span {
  color: var(--muted);
  font-size: 0.78rem;
}

.multi-city-panel {
  display: grid;
  gap: 12px;
}

.multi-city-panel[hidden] {
  display: none;
}

.multi-city-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.multi-city-heading span {
  margin-bottom: 0;
}

.text-action {
  padding: 0;
  color: var(--forest);
  background: transparent;
  border: 0;
  font-size: 0.86rem;
  font-weight: 780;
}

.multi-city-legs {
  display: grid;
  gap: 12px;
}

.multi-city-leg {
  display: grid;
  gap: 12px;
  padding: 12px;
  background: color-mix(in srgb, var(--surface) 70%, var(--field));
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.leg-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.leg-heading strong {
  color: var(--forest);
  font-size: 0.9rem;
}

.form-actions {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 10px;
  margin-top: 4px;
}

.primary-action,
.secondary-action,
.print-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 16px;
  border-radius: var(--radius);
  font-weight: 780;
}

.primary-action {
  color: var(--surface);
  background: var(--forest);
  border: 1px solid var(--forest);
}

.secondary-action,
.print-action {
  color: var(--forest);
  background: transparent;
  border: 1px solid color-mix(in srgb, var(--forest) 25%, var(--line));
}

.form-note,
.api-message,
.price-list p,
.site-footer {
  color: var(--muted);
  line-height: 1.5;
}

.form-note,
.pnr-result,
.api-message {
  margin: 0;
  font-size: 0.88rem;
}

.pnr-result:empty {
  display: none;
}

.pnr-result {
  padding: 10px 12px;
  background: color-mix(in srgb, var(--surface) 70%, var(--field));
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.pnr-result[data-tone="success"] {
  color: var(--ok);
  border-color: color-mix(in srgb, var(--ok) 30%, var(--line));
}

.pnr-result[data-tone="error"] {
  color: var(--warning);
  border-color: color-mix(in srgb, var(--warning) 30%, var(--line));
}

.pnr-confirmation {
  display: grid;
  gap: 14px;
  padding: 14px;
  background: color-mix(in srgb, var(--surface) 82%, #e8efe9);
  border: 1px solid color-mix(in srgb, var(--forest) 24%, var(--line));
  border-radius: var(--radius);
}

.pnr-confirmation[hidden] {
  display: none;
}

.confirmation-heading {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: start;
}

.confirmation-heading span,
.quote-details dt {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 780;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.confirmation-heading strong {
  color: var(--forest);
  text-align: right;
}

.quote-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 0;
}

.quote-details dd {
  margin: 4px 0 0;
  font-weight: 760;
}

.pnr-confirmation p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.confirmation-actions {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 10px;
}

button:disabled {
  cursor: wait;
  opacity: 0.68;
}

.document-section {
  display: grid;
  grid-template-columns: minmax(360px, 1.05fr) minmax(280px, 0.75fr);
  gap: 18px;
  align-items: start;
  padding: 0 0 clamp(48px, 8vw, 96px);
}

.document-panel,
.pricing-panel {
  padding: clamp(20px, 3vw, 30px);
}

.document-panel.is-prepared {
  border-color: color-mix(in srgb, var(--ok) 38%, var(--line));
  box-shadow: 0 18px 48px rgb(45 106 79 / 10%);
}

.document-panel.is-prepared .document-state {
  color: var(--ok);
  border-color: color-mix(in srgb, var(--ok) 25%, var(--line));
}

.document-panel.is-reservation {
  border-color: color-mix(in srgb, var(--forest) 46%, var(--line));
}

.document-panel.is-reservation .itinerary-preview {
  border-color: color-mix(in srgb, var(--forest) 46%, var(--line));
}

.document-panel.is-reservation .itinerary-preview::before {
  display: block;
  margin-bottom: 18px;
  padding: 9px 11px;
  color: var(--warning);
  background: color-mix(in srgb, var(--surface) 72%, #f4dcc5);
  border: 1px solid color-mix(in srgb, var(--warning) 28%, var(--line));
  border-radius: var(--radius);
  content: "TEST MODE - not a live airline reservation";
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.document-panel.is-reservation .document-state,
.document-panel.is-reservation .itinerary-header strong {
  color: var(--ok);
}

.itinerary-preview {
  padding: clamp(18px, 4vw, 30px);
  background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--forest) 22%, var(--line));
  border-radius: var(--radius);
}

.itinerary-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.itinerary-header > div:first-child {
  display: flex;
  gap: 10px;
  align-items: center;
}

.itinerary-header p,
.itinerary-header span,
.itinerary-header strong {
  display: block;
  margin: 0;
}

.itinerary-header p {
  font-weight: 800;
}

.itinerary-header > div:last-child {
  text-align: right;
}

.itinerary-header span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 780;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.itinerary-header strong {
  margin-top: 4px;
  color: var(--forest);
  font-size: 0.95rem;
}

.airline-logo-strip {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-top: 18px;
  padding: 12px;
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.airline-logo-strip[hidden] {
  display: none;
}

.airline-logo-strip > span {
  color: var(--forest);
  font-size: 0.95rem;
  font-weight: 780;
  letter-spacing: 0;
  text-transform: none;
}

.airline-logo-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  justify-content: flex-end;
  align-items: center;
}

.airline-logo-list img {
  display: block;
  width: auto;
  max-width: 160px;
  max-height: 38px;
  object-fit: contain;
}

.document-mark {
  width: 30px;
  height: 30px;
  font-size: 0.7rem;
}

.itinerary-route {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 18px;
  align-items: center;
  margin: 34px 0;
  font-family: ui-serif, Georgia, Cambria, "Times New Roman", serif;
  font-size: clamp(2.8rem, 8vw, 5.4rem);
  font-weight: 800;
  line-height: 0.9;
}

.route-line {
  height: 2px;
  background: var(--forest);
}

.segment-list {
  display: grid;
  gap: 8px;
  margin: -14px 0 28px;
}

.segment-item {
  padding: 10px 12px;
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 0.9rem;
}

.segment-topline {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin-bottom: 10px;
}

.segment-topline strong {
  color: var(--forest);
}

.segment-topline span {
  color: var(--muted);
  font-weight: 720;
  text-align: right;
}

.segment-route-detail {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.segment-airport {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.segment-airport strong {
  font-size: 1.15rem;
}

.segment-airport span,
.segment-airport time {
  color: var(--muted);
  overflow-wrap: anywhere;
  font-size: 0.82rem;
  line-height: 1.3;
}

.segment-airport time {
  color: var(--ink);
  font-weight: 760;
}

.segment-connector {
  align-self: center;
  color: var(--forest);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.itinerary-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 24px;
  margin: 0;
}

.itinerary-details div {
  min-width: 0;
}

.itinerary-details dt {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 780;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.itinerary-details dd {
  margin: 5px 0 0;
  overflow-wrap: anywhere;
  font-weight: 760;
}

.document-disclaimer {
  margin: 24px 0 0;
  padding-top: 18px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: 0.88rem;
  line-height: 1.55;
}

.print-action {
  width: 100%;
  margin-top: 16px;
}

.price-list {
  display: grid;
  gap: 14px;
  margin-top: 24px;
}

.price-list article {
  display: grid;
  grid-template-columns: 86px 1fr;
  gap: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.price-list strong {
  color: var(--accent);
}

.price-list p {
  margin-bottom: 0;
  font-size: 0.93rem;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
  justify-content: space-between;
  padding: 22px max(20px, calc((100vw - var(--max)) / 2));
  border-top: 1px solid var(--line);
  font-size: 0.86rem;
}

@media (max-width: 900px) {
  .topbar {
    grid-template-columns: 1fr auto;
  }

  .nav-links {
    display: none;
  }

  .hero-section,
  .document-section {
    grid-template-columns: 1fr;
  }

  .hero-copy {
    padding-top: 0;
  }

  .test-mode-banner {
    align-items: flex-start;
  }

  h1 {
    max-width: 11ch;
    font-size: clamp(2.45rem, 9vw, 4.2rem);
    line-height: 0.95;
  }
}

@media (max-width: 560px) {
  main {
    width: min(100% - 24px, var(--max));
  }

  .topbar {
    padding-inline: 12px;
  }

  .test-mode-banner {
    display: grid;
  }

  .top-action {
    padding-inline: 11px;
  }

  h1 {
    max-width: 12ch;
    font-size: clamp(2.15rem, 10vw, 3.15rem);
    line-height: 1;
  }

  .route-grid,
  .form-actions,
  .confirmation-actions,
  .itinerary-details,
  .quote-details,
  .price-list article,
  .segment-route-detail {
    grid-template-columns: 1fr;
  }

  .trip-type-options {
    grid-template-columns: 1fr;
  }

  .panel-heading.horizontal {
    display: grid;
  }

  .airline-logo-strip {
    display: grid;
  }

  .airline-logo-list {
    justify-content: flex-start;
  }

  .itinerary-route {
    gap: 10px;
    font-size: clamp(2.2rem, 18vw, 3.8rem);
  }

  .segment-topline,
  .multi-city-heading,
  .leg-heading {
    align-items: flex-start;
  }

  .segment-topline {
    display: grid;
  }

  .segment-topline span {
    text-align: left;
  }

  .segment-connector {
    justify-self: start;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .primary-action,
  .secondary-action,
  .print-action,
  .top-action,
  .nav-links a {
    transition: transform 160ms ease, background 160ms ease, border-color 160ms ease, color 160ms ease;
  }

  .primary-action:hover,
  .secondary-action:hover,
  .print-action:hover,
  .top-action:hover {
    transform: translateY(-1px);
  }
}

@media print {
  body {
    background: var(--surface);
  }

  .topbar,
  .hero-section,
  .pricing-panel,
  .site-footer,
  .pnr-confirmation,
  .pnr-result,
  .print-action,
  .api-message {
    display: none !important;
  }

  main,
  .document-section,
  .document-panel {
    display: block;
    width: 100%;
    margin: 0;
    padding: 0;
  }

  .document-panel {
    border: 0;
  }

  .itinerary-preview {
    border: 1px solid #333;
  }
}
