/* === Flight Deals — application styles === */

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

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--surface-2);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--color-brand); }
h1, h2, h3 { line-height: 1.25; margin: 0 0 var(--space-3); }
h1 { font-size: 1.4rem; }
h2 { font-size: 1.1rem; }
h3 { font-size: 0.95rem; }

.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: var(--space-5) var(--space-4) var(--space-7);
}

.muted { color: var(--text-muted); }
.faint { color: var(--text-faint); }
.mono { font-family: var(--font-mono); }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.stack > * + * { margin-top: var(--space-4); }

/* ── Navigation ─────────────────────────────────────────────────────────── */

.nav {
  height: var(--nav-height);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: var(--space-5);
  padding: 0 var(--space-4);
  position: sticky;
  top: 0;
  z-index: 10;
}
.nav-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  width: 100%;
  display: flex;
  align-items: center;
  gap: var(--space-5);
}
.nav-brand {
  font-weight: 650;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.01em;
}
.nav-links { display: flex; gap: var(--space-4); margin-left: var(--space-3); }
.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  padding: var(--space-1) 0;
  border-bottom: 2px solid transparent;
  font-size: 0.92rem;
}
.nav-links a:hover { color: var(--text); }
.nav-links a.active { color: var(--text); border-bottom-color: var(--color-brand); }
.nav-spacer { flex: 1; }

/* ── Cards & panels ─────────────────────────────────────────────────────── */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card-head {
  padding: var(--space-4);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}
.card-body { padding: var(--space-4); }

.banner {
  border: 1px solid var(--border);
  border-left-width: 4px;
  border-radius: var(--radius);
  padding: var(--space-3) var(--space-4);
  background: var(--surface);
}
.banner-warn { border-left-color: var(--color-warn); background: var(--color-warn-soft); }
.banner-danger { border-left-color: var(--color-danger); background: var(--color-danger-soft); }
.banner-success { border-left-color: var(--color-success); background: var(--color-success-soft); }

.flash { margin-bottom: var(--space-4); }

/* ── Deal cards ─────────────────────────────────────────────────────────── */

.deal {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: var(--space-4);
  align-items: center;
  padding: var(--space-4);
  border-bottom: 1px solid var(--border);
}
.deal:last-child { border-bottom: 0; }
.deal:hover { background: var(--surface-2); }

.deal-score {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 600;
  min-width: 3.4rem;
  text-align: center;
  padding: var(--space-2) var(--space-2);
  border-radius: var(--radius-sm);
  background: var(--color-brand-soft);
  color: var(--color-brand);
}
.deal-route { font-size: 1.05rem; font-weight: 620; letter-spacing: -0.01em; }
.deal-route a { color: inherit; text-decoration: none; }
.deal-route a:hover { color: var(--color-brand); }
.deal-meta { color: var(--text-muted); font-size: 0.88rem; margin-top: 2px; }
.deal-price { font-family: var(--font-mono); font-size: 1.2rem; font-weight: 600; }
.deal-was { color: var(--text-faint); text-decoration: line-through; font-size: 0.85rem; }
.deal-actions { display: flex; gap: var(--space-2); align-items: center; }

/* ── Badges ─────────────────────────────────────────────────────────────── */

.badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  padding: 2px var(--space-2);
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--text-muted);
  vertical-align: middle;
}
.badge-success { background: var(--color-success-soft); color: var(--color-success); }
.badge-warn { background: var(--color-warn-soft); color: var(--color-warn); }
.badge-danger { background: var(--color-danger-soft); color: var(--color-danger); }
.badge-brand { background: var(--color-brand-soft); color: var(--color-brand); }

/* ── Buttons & forms ────────────────────────────────────────────────────── */

.btn {
  font: inherit;
  font-size: 0.88rem;
  font-weight: 550;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  line-height: 1.4;
}
.btn:hover { background: var(--surface-2); }
/* --text-inverse, not #fff: in dark mode the brand is a LIGHT blue, and white on it
   measures 2.5:1 — a WCAG AA failure on the site's primary call to action. The token
   flips to near-black in dark mode, giving 7.1:1, and stays white in light mode. */
.btn-primary { background: var(--color-brand); border-color: var(--color-brand); color: var(--text-inverse); }
.btn-primary:hover { background: var(--color-brand-hover); border-color: var(--color-brand-hover); }
.btn-success { background: var(--color-success); border-color: var(--color-success); color: var(--text-inverse); }
.btn-success:hover { filter: brightness(1.08); }
.btn-quiet { background: transparent; border-color: transparent; color: var(--text-muted); }
.btn-quiet:hover { background: var(--surface-3); color: var(--text); }
.btn-sm { padding: var(--space-1) var(--space-3); font-size: 0.82rem; }

/* Attribute-prefix match rather than an explicit list: a type added later (email,
   url, search) would otherwise silently fall back to the browser default width. */
input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="submit"]),
textarea, select {
  font: inherit;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  width: 100%;
}
input:focus-visible, textarea:focus-visible, select:focus-visible, .btn:focus-visible, a:focus-visible {
  outline: 2px solid var(--color-brand);
  outline-offset: 2px;
}
label { display: block; font-size: 0.85rem; font-weight: 550; margin-bottom: var(--space-1); }
.inline-form { display: inline; }

/* ── Tables ─────────────────────────────────────────────────────────────── */

.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 0.88rem; }
th, td { padding: var(--space-2) var(--space-3); text-align: left; border-bottom: 1px solid var(--border); }
th { color: var(--text-muted); font-weight: 600; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.03em; }
tbody tr:hover { background: var(--surface-2); }
td.num, th.num { text-align: right; font-family: var(--font-mono); }

/* ── Stats ──────────────────────────────────────────────────────────────── */

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: var(--space-3); }
.stat { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--space-3); }
.stat-label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--text-muted); }
.stat-value { font-family: var(--font-mono); font-size: 1.25rem; font-weight: 600; margin-top: 2px; }

/* ── Chart ──────────────────────────────────────────────────────────────── */

.chart { width: 100%; height: auto; display: block; }
.chart-line { fill: none; stroke: var(--chart-line); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart-area { fill: var(--chart-fill); stroke: none; }
.chart-median { stroke: var(--chart-median); stroke-width: 1; stroke-dasharray: 4 3; }
.chart-point { fill: var(--chart-highlight); }
.chart-legend { display: flex; gap: var(--space-4); font-size: 0.8rem; color: var(--text-muted); margin-top: var(--space-2); flex-wrap: wrap; }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: baseline; }

/* ── Empty state ────────────────────────────────────────────────────────── */

.empty { text-align: center; padding: var(--space-7) var(--space-4); color: var(--text-muted); }
.empty-title { font-size: 1.05rem; color: var(--text); margin-bottom: var(--space-2); }

/* ── Login ──────────────────────────────────────────────────────────────── */

.login-wrap { max-width: 360px; margin: 12vh auto; padding: 0 var(--space-4); }

/* ── Detail layout ──────────────────────────────────────────────────────── */

.detail-grid { display: grid; grid-template-columns: 2fr 1fr; gap: var(--space-4); align-items: start; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: var(--space-2) var(--space-4); font-size: 0.9rem; }
.kv dt { color: var(--text-muted); }
.kv dd { margin: 0; font-family: var(--font-mono); }

/* ── Public pages ───────────────────────────────────────────────────────── */

.public-wrap { max-width: 560px; margin: 6vh auto var(--space-7); }
.public-wrap.wide { max-width: 720px; }

.hero-title { font-size: 2rem; letter-spacing: -0.02em; margin-bottom: var(--space-3); }
.hero-lead { font-size: 1.08rem; color: var(--text-muted); margin-bottom: var(--space-5); }

/* Numbered explanation of how the service works. Ordered because the sequence is
   the point — poll, compare, human check, email. */
.steps { list-style: none; padding: 0; margin: 0; counter-reset: step; }
.steps li {
  position: relative; padding-left: var(--space-7); margin-bottom: var(--space-4); counter-increment: step;
}
.steps li::before {
  content: counter(step);
  position: absolute; left: 0; top: 0;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--color-brand-soft); color: var(--color-brand);
  font-size: 0.85rem; font-weight: 650;
  display: flex; align-items: center; justify-content: center;
}
.steps strong { display: block; margin-bottom: 2px; }
.steps span { color: var(--text-muted); font-size: 0.92rem; }

/* Long-form legal and informational copy. */
.prose { max-width: 68ch; }
.prose h2 { font-size: 1.1rem; margin-top: var(--space-6); }
.prose h2:first-of-type { margin-top: var(--space-5); }
.prose p, .prose li { color: var(--text-muted); }
.prose ul { padding-left: var(--space-5); }
.prose li { margin-bottom: var(--space-2); }
.prose a { color: var(--color-brand); }
.updated { font-size: 0.85rem; color: var(--text-faint); }

/* Honeypot. Positioned off-canvas rather than display:none — some bots skip inputs
   that are explicitly hidden, and the point is that they fill this one in. */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ── Landing page ───────────────────────────────────────────────────────── */

/* Full-bleed wrapper. .public-wrap caps at 720px, which is right for prose and
   wrong for a hero — a 720px column on a 1440px screen reads as a document. */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.landing { max-width: var(--container-max); margin: 0 auto; padding: 0 var(--space-4); }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: var(--space-7);
  align-items: center;
  padding: var(--space-8) 0 var(--space-7);
}
.hero-copy { max-width: 34rem; }
.hero-display {
  font-size: var(--font-display);
  line-height: 1.08;
  letter-spacing: -0.025em;
  margin: 0 0 var(--space-4);
}
.hero-sub { font-size: var(--font-lead); color: var(--text-muted); margin: 0 0 var(--space-5); }
.hero-note { font-size: 0.83rem; color: var(--text-faint); margin: var(--space-3) 0 0; }

/* Inline capture. The old CTA linked to a second page; every click between
   interest and capture costs subscribers. */
.signup-inline { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.signup-inline input[type="email"] { flex: 1 1 16rem; min-width: 0; }
.signup-inline .btn { flex: 0 0 auto; }

.origin-row { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-3); }
.origin-row label {
  display: flex; align-items: center; gap: var(--space-2);
  font-weight: 400; font-size: 0.9rem; margin: 0;
}
.origin-row input { width: auto; }

/* Proof panel — the evidence half of the hero. */
.proof {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.proof-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.proof-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); }
.proof-body { padding: var(--space-4); }
.proof-route { font-size: 1.15rem; font-weight: 620; letter-spacing: -0.01em; }
.proof-price { font-family: var(--font-mono); font-size: 2rem; font-weight: 600; color: var(--color-success); line-height: 1.1; }
/* The number is the headline; the currency code is a qualifier and should not
   compete with it at the same size in a monospace face. */
.proof-ccy { font-size: 0.95rem; font-weight: 500; color: var(--text-muted); margin-right: 0.35em; }
.proof-was { color: var(--text-faint); text-decoration: line-through; font-size: 0.92rem; }
.proof-verdict { font-size: 0.9rem; color: var(--text-muted); margin-top: var(--space-3); }

/* Trust numbers. A stat tile is the right form for a single headline figure —
   it is deliberately not a chart. */
.proof-strip {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--space-4);
  padding: var(--space-6) 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.figure-value { font-family: var(--font-mono); font-size: 1.5rem; font-weight: 600; letter-spacing: -0.02em; }
/* Mono is for numerals. A word set in it reads as a rendering fault. */
.figure-text { font-family: var(--font-sans); font-weight: 650; letter-spacing: -0.01em; }
.figure-label { font-size: 0.82rem; color: var(--text-muted); margin-top: 2px; }

/* How it works, as a scannable row rather than a wall of prose. */
.how-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-5); padding: var(--space-7) 0;
}
.how-step-n {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--color-brand-soft); color: var(--color-brand);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; font-weight: 650; margin-bottom: var(--space-2);
}
.how-step h3 { margin: 0 0 var(--space-1); font-size: 0.98rem; }
.how-step p { margin: 0; font-size: 0.9rem; color: var(--text-muted); }

.landing-cta { padding: var(--space-7) 0 var(--space-8); text-align: center; }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: var(--space-6); padding-top: var(--space-6); }
  .hero-copy { max-width: none; }
}

/* The stylesheet had no motion at all. Anything added is opt-out by default. */
@media (prefers-reduced-motion: no-preference) {
  .btn, .proof, .deal { transition: background var(--transition), border-color var(--transition),
                                    box-shadow var(--transition), transform var(--transition); }
  .proof:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
}

/* ── Footer ─────────────────────────────────────────────────────────────── */

.site-footer {
  border-top: 1px solid var(--border);
  margin-top: var(--space-7);
  padding: var(--space-5) var(--space-4);
  background: var(--surface-2);
}
.footer-inner { max-width: var(--container-max); margin: 0 auto; }
.footer-links { display: flex; flex-wrap: wrap; gap: var(--space-4); margin-bottom: var(--space-3); }
.footer-links a { color: var(--text-muted); text-decoration: none; font-size: 0.88rem; }
.footer-links a:hover { color: var(--text); text-decoration: underline; }
.footer-identity { font-size: 0.85rem; color: var(--text-muted); margin: 0 0 var(--space-2); }
.footer-identity a { color: var(--text-muted); }
.footer-note { font-size: 0.8rem; color: var(--text-faint); margin: 0; max-width: 62ch; }

/* ── Responsive ─────────────────────────────────────────────────────────── */

@media (max-width: 820px) {
  .detail-grid { grid-template-columns: 1fr; }
  .deal { grid-template-columns: auto 1fr; }
  .deal-actions { grid-column: 1 / -1; justify-content: flex-end; }
}

/* Most traffic here arrives from a link in an email, which is overwhelmingly read on
   a phone — so the public pages and the confirm/unsubscribe landings matter more at
   this width than the admin views do. */
@media (max-width: 560px) {
  .container { padding-left: var(--space-3); padding-right: var(--space-3); }
  .public-wrap { margin-top: var(--space-5); }
  .hero-title { font-size: 1.55rem; }
  .hero-lead { font-size: 1rem; }

  /* The admin nav is a single flex row with a brand, three links and two buttons;
     below this width it overflows rather than wrapping. The fixed height on .nav has
     to go too, or the wrapped second row is simply clipped. */
  .nav { height: auto; padding-top: var(--space-2); padding-bottom: var(--space-2); }
  .nav-inner { flex-wrap: wrap; gap: var(--space-3); }
  .nav-links { width: 100%; margin-left: 0; order: 3; gap: var(--space-3); overflow-x: auto; }
  .nav-spacer { flex: 1; }

  .deal { grid-template-columns: 1fr; }
  .deal-actions { justify-content: flex-start; }
  .stats { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
}
