/* Travelers Code: colors and fonts matched to travelerscode.org */
:root {
  --sand: #ddc6a3;        /* main brand background on travelerscode.org */
  --sand-light: #efe3d0;
  --sand-pale: #f8f3eb;
  --brown: #85745a;       /* brand accent */
  --brown-dark: #4a3c2e;  /* logo color */
  --ink: #161616;
  --ink-soft: #474747;
  --muted: #6e665c;
  --line: #d9cbb5;
  --white: #ffffff;
  --green: #2f6b3a;
  --green-bg: #e3efe1;
  --warn-bg: #fbf1dd;
  --warn-line: #e2c58f;
  --red: #9b2c2c;
  --radius: 10px;
  --shadow: 0 10px 30px rgba(52, 40, 25, .12);
  --head: 'Montserrat', system-ui, sans-serif;
  --body: 'Roboto', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: var(--body); color: var(--ink); background: var(--sand-pale); line-height: 1.5; -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: var(--head); line-height: 1.15; margin: 0 0 .5em; }
a { color: var(--brown-dark); }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
[hidden] { display: none !important; }

.demo-banner { background: #b42318; color: #fff; text-align: center; font-weight: 700; padding: 10px 16px; position: sticky; top: 0; z-index: 50; }

/* Header */
.site-header { background: var(--sand); border-bottom: 1px solid rgba(0,0,0,.06); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--brown-dark); font-family: var(--head); font-weight: 800; font-size: 18px; letter-spacing: .5px; text-transform: uppercase; }
.brand-logo { border-radius: 4px; background: var(--brown-dark); }
.nav { display: flex; gap: 22px; }
.nav a { text-decoration: none; color: var(--ink); font-weight: 500; font-size: 15px; }
.nav a:hover { color: var(--brown); }
@media (max-width: 640px) { .nav a:not(:last-child) { display: none; } }

/* Hero + search */
.hero { background: var(--sand); padding: 48px 0 64px; }
.eyebrow { font-family: var(--head); text-transform: uppercase; letter-spacing: 2px; font-size: 13px; font-weight: 700; color: var(--brown-dark); margin: 0 0 10px; }
.hero h1 { font-size: clamp(30px, 5vw, 52px); font-weight: 700; max-width: 820px; }
.lead { font-size: clamp(16px, 2vw, 19px); max-width: 680px; color: var(--ink-soft); margin: 0 0 28px; }

.search-card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.trip-toggle { display: inline-flex; background: var(--sand-light); border-radius: 999px; padding: 4px; margin-bottom: 16px; }
.trip-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.trip-toggle span { display: block; padding: 7px 18px; border-radius: 999px; cursor: pointer; font-weight: 500; font-size: 14px; color: var(--ink-soft); transition: background .15s, color .15s; }
.trip-toggle input:checked + span { background: var(--ink); color: var(--white); }
.trip-toggle input:focus-visible + span { outline: 2px solid var(--brown); outline-offset: 2px; }

.fields { display: grid; grid-template-columns: 1fr auto 1fr 170px 170px; gap: 12px; align-items: end; }
.fields:has(#return-field[hidden]) { grid-template-columns: 1fr auto 1fr 190px; }
@media (max-width: 900px) { .fields, .fields:has(#return-field[hidden]) { grid-template-columns: 1fr 1fr; } .swap { display: none; } .field.ac { grid-column: span 2; } }
@media (max-width: 480px) { .fields, .fields:has(#return-field[hidden]) { grid-template-columns: 1fr; } .field.ac { grid-column: auto; } }
.field { position: relative; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label { font-size: 13px; font-weight: 500; color: var(--muted); }
.field input { font: inherit; font-size: 16px; padding: 13px 14px; border: 1.5px solid var(--line); border-radius: 8px; background: var(--white); color: var(--ink); width: 100%; transition: border-color .15s, box-shadow .15s; }
.field input:focus { outline: none; border-color: var(--brown); box-shadow: 0 0 0 3px rgba(133,116,90,.2); }
.field input.valid { border-color: var(--brown); }
.swap { height: 50px; width: 40px; border: 1.5px solid var(--line); background: var(--white); border-radius: 8px; cursor: pointer; font-size: 18px; color: var(--brown-dark); }
.swap:hover { background: var(--sand-pale); }

.ac-list { position: absolute; top: 100%; left: 0; right: 0; margin: 6px 0 0; padding: 6px; list-style: none; background: var(--white); border-radius: 8px; box-shadow: var(--shadow); border: 1px solid var(--line); z-index: 20; max-height: 340px; overflow-y: auto; min-width: 280px; }
.ac-list li { display: flex; gap: 12px; align-items: center; padding: 9px 10px; border-radius: 6px; cursor: pointer; }
.ac-list li[aria-selected="true"], .ac-list li:hover { background: var(--sand-pale); }
.ac-code { font-family: var(--head); font-weight: 800; font-size: 14px; background: var(--sand-light); color: var(--brown-dark); border-radius: 5px; padding: 3px 7px; min-width: 46px; text-align: center; }
.ac-main { font-weight: 500; font-size: 15px; }
.ac-sub { font-size: 13px; color: var(--muted); }
.ac-empty { color: var(--muted); font-size: 14px; padding: 10px; cursor: default !important; background: none !important; }

.form-error { color: var(--red); font-weight: 500; margin: 14px 0 0; }
.btn-primary { margin-top: 18px; width: 100%; background: var(--ink); color: var(--white); border: 0; border-radius: 4px; padding: 16px; font-family: var(--head); font-size: 15px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; cursor: pointer; transition: background .15s, transform .05s; }
.btn-primary:hover { background: #333; }
.btn-primary:active { transform: translateY(1px); }
.btn-primary:disabled { background: #777; cursor: wait; }
.fine { font-size: 13px; color: var(--muted); margin: 10px 0 0; }

/* Results */
.results { padding-top: 36px; }
.results:empty { padding: 0; }
.leg-title { font-size: 22px; margin: 18px 0 14px; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.leg-title small { font-family: var(--body); font-weight: 400; font-size: 15px; color: var(--muted); }
.summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 18px; }
@media (max-width: 640px) { .summary { grid-template-columns: 1fr; } }
.stat { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.stat .k { font-size: 13px; color: var(--muted); }
.stat .v { font-family: var(--head); font-weight: 700; font-size: 22px; }
.toolbar { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar select { font: inherit; padding: 8px 10px; border: 1.5px solid var(--line); border-radius: 6px; background: var(--white); }
.toolbar label { font-size: 14px; color: var(--muted); display: flex; gap: 8px; align-items: center; }

.card { background: var(--white); border-radius: var(--radius); box-shadow: 0 2px 10px rgba(52,40,25,.07); border: 1px solid #ebe1d1; padding: 18px 20px; margin-bottom: 14px; display: grid; grid-template-columns: 1fr 210px; gap: 18px; animation: rise .25s ease-out both; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (max-width: 720px) { .card { grid-template-columns: 1fr; } }
.card-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.pill { font-size: 12px; font-weight: 700; padding: 4px 9px; border-radius: 999px; text-transform: uppercase; letter-spacing: .5px; }
.pill.save { background: var(--green-bg); color: var(--green); }
.pill.hidden { background: var(--sand-light); color: var(--brown-dark); }
.route-note { font-size: 14px; color: var(--ink-soft); }
.route-note strong { color: var(--ink); }

.timeline { display: flex; flex-direction: column; gap: 0; }
.seg { display: grid; grid-template-columns: 34px 1fr; gap: 12px; padding: 8px 0; }
.seg + .seg { border-top: 1px dashed #e6dccb; }
.seg.skip { opacity: .5; }
.logo { width: 34px; height: 34px; border-radius: 6px; background: var(--sand-light); display: grid; place-items: center; font-family: var(--head); font-weight: 800; font-size: 12px; color: var(--brown-dark); overflow: hidden; }
.logo img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.seg-main { font-weight: 500; }
.seg-main .t { font-family: var(--head); font-weight: 700; }
.seg-sub { font-size: 13px; color: var(--muted); }
.layover { font-size: 13px; color: var(--muted); padding: 2px 0 2px 46px; }
.getoff { margin: 6px 0; padding: 8px 12px 8px 46px; background: var(--green-bg); color: var(--green); border-radius: 6px; font-size: 14px; font-weight: 700; }
.skip-label { font-size: 12px; text-transform: uppercase; letter-spacing: .5px; font-weight: 700; color: var(--muted); margin-top: 4px; padding-left: 46px; }

.price-col { display: flex; flex-direction: column; justify-content: center; align-items: stretch; gap: 8px; border-left: 1px solid #eee3d3; padding-left: 18px; }
@media (max-width: 720px) { .price-col { border-left: 0; padding-left: 0; border-top: 1px solid #eee3d3; padding-top: 14px; } }
.price { font-family: var(--head); font-weight: 800; font-size: 32px; line-height: 1; }
.price small { font-size: 14px; font-weight: 600; color: var(--muted); }
.was { font-size: 14px; color: var(--muted); }
.was s { color: var(--red); }
.btn-book { display: block; text-align: center; background: var(--ink); color: var(--white); text-decoration: none; padding: 12px; border-radius: 4px; font-family: var(--head); font-weight: 700; font-size: 13px; letter-spacing: 1px; text-transform: uppercase; }
.btn-book:hover { background: #333; }
.btn-alt { text-align: center; font-size: 13px; }

.notice { background: var(--warn-bg); border: 1px solid var(--warn-line); border-radius: var(--radius); padding: 14px 16px; margin: 0 0 16px; font-size: 15px; }
.notice.error { background: #fbe9e9; border-color: #e7b4b4; color: var(--red); }
.notice.ok { background: var(--green-bg); border-color: #b7d3b3; }
.empty { background: var(--white); border: 1px dashed var(--line); border-radius: var(--radius); padding: 26px; text-align: center; color: var(--ink-soft); }
.checked { font-size: 13px; color: var(--muted); margin: 6px 0 22px; }
details.regular { margin: 10px 0 30px; }
details.regular summary { cursor: pointer; font-weight: 500; color: var(--brown-dark); margin-bottom: 12px; }

.loading { background: var(--white); border-radius: var(--radius); padding: 28px; text-align: center; border: 1px solid var(--line); }
.plane-track { position: relative; height: 26px; max-width: 360px; margin: 6px auto 14px; border-bottom: 2px dashed var(--line); }
.plane-track span { position: absolute; left: 0; top: 0; font-size: 22px; animation: fly 2.4s ease-in-out infinite; }
@keyframes fly { 0% { left: 0; } 50% { left: calc(100% - 24px); } 100% { left: 0; } }
@media (prefers-reduced-motion: reduce) { .plane-track span, .card { animation: none; } }
.loading p { margin: 4px 0; color: var(--ink-soft); }

/* Info sections */
.how, .rules { padding: 54px 20px 10px; }
.how h2, .rules h2 { font-size: 28px; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 780px) { .steps { grid-template-columns: 1fr; } }
.step { background: var(--white); border-radius: var(--radius); padding: 20px; border: 1px solid #ebe1d1; }
.step .num { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--brown-dark); color: var(--sand-light); font-family: var(--head); font-weight: 800; margin-bottom: 10px; }
.step h3 { font-size: 17px; }
.step p { margin: 0; color: var(--ink-soft); font-size: 15px; }
.rules ul { background: var(--white); border-radius: var(--radius); border: 1px solid #ebe1d1; padding: 18px 22px 18px 40px; margin: 0; }
.rules li { margin: 8px 0; color: var(--ink-soft); }
.rules li strong { color: var(--ink); }

.site-footer { margin-top: 60px; background: var(--sand); padding: 28px 0; font-size: 14px; }
.site-footer p { margin: 4px 0; }
