/* Golden Fares: sky blue, fresh green and sunny yellow, from the logo. */
:root {
  --bg: #f1f7ff;
  --surface: #ffffff;
  --text: #102033;
  --muted: #55667d;
  --line: #d8e5f4;
  --blue: #1a6fe0;
  --blue-soft: #e5f0ff;
  --green: #108a55;
  --green-soft: #e1f6ea;
  --yellow: #ffc83d;
  --yellow-soft: #fff5d1;
  --yellow-text: #7a5600;
  --accent: #1a6fe0;
  --accent-text: #ffffff;
  --good: #0f7d4c;
  --good-bg: #e1f6ea;
  --warn-bg: #fff5d1;
  --warn-text: #6e4e00;
  --error: #c0262d;
  --hero-from: #1a6fe0;
  --hero-mid: #1c9bd8;
  --hero-to: #14b07a;
  --button-from: #1a6fe0;
  --button-to: #108a55;
  --shadow: 0 10px 30px rgb(26 111 224 / 0.10), 0 2px 6px rgb(16 32 51 / 0.05);
  --shadow-hover: 0 16px 36px rgb(26 111 224 / 0.16), 0 3px 8px rgb(16 32 51 / 0.06);
  --radius: 16px;
  --display: "Nunito", "Segoe UI Rounded", "Segoe UI", system-ui, sans-serif;
  --body: "Nunito Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1524;
    --surface: #12223a;
    --text: #e9f1fb;
    --muted: #9db0c8;
    --line: #24395a;
    --blue: #5aa9ff;
    --blue-soft: #15305a;
    --green: #4fd68f;
    --green-soft: #12352a;
    --yellow: #ffd666;
    --yellow-soft: #3a3012;
    --yellow-text: #ffd97a;
    --accent: #5aa9ff;
    --accent-text: #061222;
    --good: #5fe0a0;
    --good-bg: #12352a;
    --warn-bg: #3a3012;
    --warn-text: #ffd97a;
    --error: #ff8a80;
    --hero-from: #0f468f;
    --hero-mid: #0c6a96;
    --hero-to: #0b7653;
    --button-from: #2f86f0;
    --button-to: #13a065;
    --shadow: 0 10px 30px rgb(0 0 0 / 0.35);
    --shadow-hover: 0 16px 36px rgb(0 0 0 / 0.45);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  font-family: var(--body);
  background:
    radial-gradient(900px 400px at 100% 260px, rgb(255 200 61 / 0.12), transparent 70%),
    radial-gradient(800px 400px at 0% 520px, rgb(20 176 122 / 0.10), transparent 70%),
    var(--bg);
  color: var(--text);
  line-height: 1.5;
}
main { max-width: 1000px; margin: -56px auto 0; padding: 0 16px 64px; position: relative; }
button, input, select { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--display); }

.banner { background: var(--warn-bg); color: var(--warn-text); text-align: center; padding: 8px 16px; font-size: 14px; font-weight: 600; }

/* Header: a sky gradient with a soft sun, like the logo */
.hero {
  position: relative; overflow: hidden; color: #ffffff;
  background: linear-gradient(120deg, var(--hero-from), var(--hero-mid) 55%, var(--hero-to));
}
.hero::before, .hero::after { content: ""; position: absolute; border-radius: 50%; pointer-events: none; }
.hero::before { width: 360px; height: 360px; right: -80px; top: -150px; background: radial-gradient(circle, rgb(255 226 120 / 0.85), rgb(255 200 61 / 0.35) 45%, transparent 70%); }
.hero::after { width: 900px; height: 260px; left: -120px; bottom: -190px; background: rgb(255 255 255 / 0.10); }
.hero-inner { position: relative; z-index: 1; max-width: 1000px; margin: 0 auto; padding: 22px 16px 88px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.brand img { filter: drop-shadow(0 4px 10px rgb(0 0 0 / 0.18)); }
.wordmark { font-family: var(--display); font-weight: 900; font-size: 26px; letter-spacing: -0.01em; }
.wordmark span { color: #ffe27a; margin-left: 4px; }
.hero h1 { margin: 26px 0 0; font-size: clamp(26px, 4.4vw, 40px); line-height: 1.15; font-weight: 900; letter-spacing: -0.02em; max-width: 22ch; text-wrap: balance; }
.hero p { margin: 8px 0 0; font-size: 17px; opacity: 0.92; max-width: 60ch; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.search { margin-bottom: 22px; padding: 20px; border-top: 4px solid var(--yellow); }
.trip-type { display: flex; gap: 8px; margin-bottom: 14px; font-size: 14px; }
.trip-type label { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--blue-soft); cursor: pointer; font-weight: 600; }
.trip-type input { accent-color: var(--blue); margin: 0; }
.fields { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; color: var(--muted); flex: 1 1 150px; min-width: 0; }
.field.place { flex: 2 1 200px; }
.field.small { flex: 0 1 110px; }
.field.medium { flex: 0 1 190px; }
.field input, .field select {
  padding: 11px 12px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--bg); width: 100%; font-weight: 400;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field input:focus, .field select:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px rgb(26 111 224 / 0.18); }
.swap {
  border: 0; background: var(--yellow); color: #3d2c00; border-radius: 50%; width: 42px; height: 42px; cursor: pointer; flex: none;
  font-size: 18px; font-weight: 700; transition: transform 0.25s;
}
.swap:hover { transform: rotate(180deg); }
.swap:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.search-row { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; margin-top: 16px; }
.check { font-size: 14px; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.check input { accent-color: var(--green); width: 18px; height: 18px; }

button.primary, a.primary {
  background: linear-gradient(120deg, var(--button-from), var(--button-to));
  color: #ffffff; border: 0; border-radius: 999px; padding: 12px 26px; font-weight: 700; cursor: pointer;
  box-shadow: 0 6px 16px rgb(26 111 224 / 0.25); transition: transform 0.15s, box-shadow 0.15s;
}
button.primary:hover, a.primary:hover { transform: translateY(-1px); box-shadow: 0 10px 22px rgb(26 111 224 / 0.32); }
button.primary:focus-visible, a.primary:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }
#search-btn { font-size: 16px; padding: 13px 32px; }
a.button { display: inline-block; text-decoration: none; text-align: center; }
button.primary:disabled { opacity: 0.6; cursor: progress; transform: none; }
.error { color: var(--error); margin: 12px 0 0; font-size: 14px; }

.status { color: var(--muted); margin: 8px 0 16px; }
.spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid var(--line); border-top-color: var(--blue); border-right-color: var(--green); border-radius: 50%; animation: spin 0.8s linear infinite; vertical-align: -2px; margin-right: 8px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Tip cards: each kind of advice gets its own colour */
.insights { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-bottom: 16px; }
.insight { --tint: var(--blue); --tint-soft: var(--blue-soft); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.insight::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: var(--tint); }
.insight.date { --tint: var(--yellow); --tint-soft: var(--yellow-soft); }
.insight.time { --tint: var(--blue); --tint-soft: var(--blue-soft); }
.insight.book { --tint: var(--green); --tint-soft: var(--green-soft); }
.insight.search { --tint: var(--hero-mid); --tint-soft: var(--blue-soft); }
.insight .label { display: inline-block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text); background: var(--tint-soft); padding: 2px 8px; border-radius: 999px; }
.insight h3 { margin: 8px 0 4px; font-size: 17px; font-weight: 800; }
.insight p { margin: 0; font-size: 14px; color: var(--muted); }

.flex { margin-bottom: 16px; }
.flex h2 { font-size: 16px; font-weight: 800; margin: 0 0 10px; }
.flex-days { display: grid; grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); gap: 8px; }
.flex-day { border: 1.5px solid var(--line); border-radius: 12px; padding: 8px 4px; text-align: center; font-size: 13px; background: var(--bg); transition: transform 0.15s, border-color 0.15s; }
.flex-day:hover { transform: translateY(-2px); border-color: var(--blue); }
.flex-day strong { display: block; font-size: 14px; }
.flex-day.selected { border-color: var(--blue); background: var(--blue-soft); }
.flex-day.cheapest { background: var(--green-soft); color: var(--good); border-color: var(--green); }
.flex-day button { all: unset; cursor: pointer; display: block; }
.flex-day button:focus-visible { outline: 2px solid var(--blue); outline-offset: 4px; border-radius: 6px; }

.results { display: flex; flex-direction: column; gap: 12px; }
.offer { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; transition: transform 0.15s, box-shadow 0.15s; border-left: 4px solid transparent; }
.offer:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); border-left-color: var(--yellow); }
.offer .rank { font-size: 12px; font-weight: 700; color: var(--muted); }
.offer .airline { display: flex; gap: 8px; align-items: center; font-weight: 700; margin: 4px 0 6px; }
.offer .airline img { width: 26px; height: 26px; border-radius: 6px; }
.leg { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; font-size: 14px; padding: 2px 0; }
.leg .time { font-weight: 800; font-size: 17px; font-family: var(--display); }
.leg .mid { text-align: center; color: var(--muted); font-size: 12px; border-bottom: 2px dotted var(--line); padding-bottom: 2px; }
.leg .code { color: var(--muted); font-size: 12px; }
.leg .plus { color: var(--error); font-size: 11px; vertical-align: super; }
.price { text-align: right; }
.price strong { display: block; font-size: 24px; font-family: var(--display); font-weight: 900; color: var(--blue); }
.price small { color: var(--muted); display: block; margin-bottom: 8px; }
.tag { display: inline-block; font-size: 11px; padding: 2px 9px; border-radius: 999px; background: var(--good-bg); color: var(--good); margin-left: 6px; font-weight: 700; }
.tag.fastest { background: var(--blue-soft); color: var(--blue); }
.tag.other-date { background: var(--yellow-soft); color: var(--yellow-text); }
.live-more { margin-top: 16px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; background: linear-gradient(120deg, var(--blue-soft), var(--green-soft)); }
.live-more p, .status p { margin: 0 0 10px; }
.status .button + .link { margin-left: 12px; }
.live-more p { margin: 0; color: var(--text); font-weight: 600; }

.site-footer { max-width: 1000px; margin: 0 auto; padding: 0 16px 32px; color: var(--muted); font-size: 13px; }
.site-footer p { margin: 0 0 8px; }
button.link { background: none; border: 0; padding: 0; color: var(--muted); text-decoration: underline; cursor: pointer; font-size: 13px; }
#owner-dialog .dialog-actions { flex-wrap: wrap; }
dialog { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--text); width: min(720px, calc(100vw - 32px)); max-height: calc(100vh - 32px); padding: 22px; box-shadow: var(--shadow-hover); }
dialog::backdrop { background: rgb(8 24 48 / 0.5); }
dialog h2 { margin-top: 0; }
.passenger { border: 1px solid var(--line); border-radius: 12px; margin: 0 0 12px; padding: 12px; }
.passenger legend { font-weight: 700; padding: 0 6px; }
.hint, .book-summary { color: var(--muted); font-size: 14px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 12px; }
.dialog-actions button:not(.primary) { background: none; border: 1.5px solid var(--line); border-radius: 999px; padding: 10px 18px; cursor: pointer; }
.confirmation { text-align: center; padding: 12px; }
.confirmation .ref { font-size: 32px; font-weight: 800; letter-spacing: 0.15em; margin: 8px 0; font-family: var(--display); color: var(--green); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation-duration: 0.01ms !important; }
}

@media (max-width: 640px) {
  .hero-inner { padding: 18px 16px 80px; }
  .wordmark { font-size: 22px; }
  .brand img { width: 44px; height: 44px; }
  .hero p { font-size: 15px; }
  .offer { grid-template-columns: 1fr; }
  .price { text-align: left; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
  .price small { margin: 0; }
  .flex-days { grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); }
  .swap { align-self: center; transform: rotate(90deg); }
  .swap:hover { transform: rotate(270deg); }
}
