:root {
  --ink: #0b2545;
  --ink-2: #13385f;
  --paper: #eaeff4;
  --surface: #ffffff;
  --line: #d7dee7;
  --muted: #5c6b7d;
  --accent: #0e8f9c;
  --accent-ink: #0a6a74;
  --deal: #12784f;
  --deal-bg: #e3f3ea;
  --amber: #e0972a;
  --shadow: 0 1px 2px rgba(11, 37, 69, 0.06), 0 12px 30px -18px rgba(11, 37, 69, 0.35);
  --radius: 14px;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --sans: "Inter", system-ui, sans-serif;
  --display: "Space Grotesk", var(--sans);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 80% -10%, #dfeaf1 0%, transparent 60%),
    var(--paper);
  min-height: 100vh;
  line-height: 1.5;
}

/* Topbar */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px clamp(16px, 4vw, 40px);
  max-width: 1040px;
  margin: 0 auto;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  color: var(--ink);
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 32px; height: 32px;
  background: var(--ink);
  color: #fff;
  border-radius: 9px;
  transform: rotate(-8deg);
  font-size: 16px;
}
.brand-name {
  font-family: var(--display);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.02em;
}
.lang { display: inline-flex; align-items: center; gap: 6px; }
.lang-btn {
  border: 0; background: none; cursor: pointer;
  font-family: var(--mono); font-size: 13px; font-weight: 600;
  color: var(--muted); padding: 4px 6px; border-radius: 6px;
}
.lang-btn.is-active { color: var(--ink); background: #fff; box-shadow: var(--shadow); }
.lang-sep { color: var(--line); }

/* Layout */
.wrap { max-width: 1040px; margin: 0 auto; padding: 8px clamp(16px, 4vw, 40px) 60px; }

.hero { padding: 22px 0 26px; max-width: 640px; }
.eyebrow {
  font-family: var(--mono); text-transform: uppercase; letter-spacing: 0.18em;
  font-size: 12px; color: var(--accent-ink); margin: 0 0 12px;
}
.title {
  font-family: var(--display); font-weight: 700;
  font-size: clamp(30px, 5vw, 46px); line-height: 1.05;
  letter-spacing: -0.03em; margin: 0 0 12px;
}
.lede { color: var(--muted); font-size: 17px; margin: 0; }

/* Mode switch (Voos / Ônibus) */
.modes {
  display: inline-flex; gap: 6px; padding: 5px;
  background: var(--ink); border-radius: 14px; margin-bottom: 16px;
}
.mode {
  border: 0; background: none; cursor: pointer;
  font-family: var(--display); font-weight: 600; font-size: 15px;
  color: #b8c6d8; padding: 10px 20px; border-radius: 10px;
  display: inline-flex; align-items: center; gap: 8px;
}
.mode:hover { color: #fff; }
.mode.is-active { background: #fff; color: var(--ink); box-shadow: var(--shadow); }

.mode-panel { display: none; }
.mode-panel.is-active { display: block; }

/* Tabs */
.tabs {
  display: inline-flex; gap: 2px; padding: 4px;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow); margin-bottom: 18px; flex-wrap: wrap;
}
.tab {
  border: 0; background: none; cursor: pointer;
  font-family: var(--sans); font-weight: 600; font-size: 14px;
  color: var(--muted); padding: 9px 15px; border-radius: 8px;
}
.tab:hover { color: var(--ink); }
.tab.is-active { background: var(--ink); color: #fff; }

/* Panels + form */
.panel { display: none; }
.panel.is-active { display: block; }

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.form {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px;
  padding: 18px;
}
.field { display: flex; flex-direction: column; gap: 6px; flex: 1 1 180px; min-width: 0; }
.field--sm { flex: 0 1 150px; }
.field--xs { flex: 0 1 96px; }
.field label {
  font-size: 12px; font-weight: 600; color: var(--muted);
  display: flex; align-items: center; gap: 6px;
}
.opt {
  font-weight: 500; font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--muted); background: var(--paper); padding: 1px 6px; border-radius: 20px;
}
.field input, .field select {
  font-family: var(--sans); font-size: 15px; color: var(--ink);
  border: 1px solid var(--line); border-radius: 10px;
  padding: 11px 12px; background: #fff; width: 100%;
}
.field input:focus, .field select:focus {
  outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent);
}
.swap {
  flex: 0 0 auto; align-self: flex-end; margin-bottom: 3px;
  width: 40px; height: 40px; border-radius: 10px;
  border: 1px solid var(--line); background: #fff; cursor: pointer;
  font-size: 17px; color: var(--ink-2);
}
.swap:hover { background: var(--paper); }
.go {
  flex: 1 1 100%;
  font-family: var(--display); font-weight: 600; font-size: 15px;
  color: #fff; background: var(--accent); border: 0; border-radius: 10px;
  padding: 13px 18px; cursor: pointer; letter-spacing: -0.01em;
}
.go:hover { background: var(--accent-ink); }
.go:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* Notice (config / info) */
.notice {
  margin: 18px 0 0; padding: 14px 16px; border-radius: 10px;
  background: #fff7e6; border: 1px solid #f0dcae; color: #6b4f10; font-size: 14px;
  line-height: 1.55;
}
.notice a { color: var(--accent-ink); font-weight: 600; }
.notice strong { color: #5a4209; }

/* Status */
.status { margin: 18px 0 0; color: var(--muted); font-size: 15px; }
.status.err { color: #b23b3b; }
.spinner {
  display: inline-block; width: 15px; height: 15px; margin-right: 8px;
  border: 2px solid var(--line); border-top-color: var(--accent);
  border-radius: 50%; animation: spin 0.7s linear infinite; vertical-align: -2px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Results */
.results { margin-top: 18px; display: grid; gap: 14px; }
.results.grid { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }

/* Boarding-pass card (signature) */
.pass {
  display: grid; grid-template-columns: 1fr auto;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
}
.pass-main { padding: 16px 18px; min-width: 0; }
.pass-route {
  display: flex; align-items: center; gap: 12px;
  font-family: var(--mono); font-weight: 600; font-size: 20px; color: var(--ink);
}
.pass-route .arrow { color: var(--accent); font-family: var(--sans); }
.pass-route.bus .pass-code { font-family: var(--sans); font-size: 16px; font-weight: 600; }
.panel-hint { margin: 0 0 12px; color: var(--muted); font-size: 14px; max-width: 640px; }
.pass-price.na { font-family: var(--sans); font-size: 14px; font-weight: 600; color: var(--muted); }
.pass-route .city { font-family: var(--sans); font-size: 12px; font-weight: 500; color: var(--muted); display: block; margin-top: 2px; }
.pass-code { display: flex; flex-direction: column; }
.pass-meta {
  display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 12px;
  font-size: 13px; color: var(--muted);
}
.pass-meta b { color: var(--ink); font-weight: 600; }
.chip {
  font-family: var(--mono); font-size: 11px; font-weight: 600;
  padding: 2px 8px; border-radius: 20px; background: var(--paper); color: var(--ink-2);
}
.chip.nonstop { background: var(--deal-bg); color: var(--deal); }
.chip.klass { background: #eef0ff; color: #4b48b5; }
.chip.seats { background: #fff3e0; color: #a9670f; }

/* Perforated price stub */
.pass-stub {
  position: relative; display: flex; flex-direction: column;
  justify-content: center; align-items: flex-end; gap: 4px;
  padding: 16px 18px; min-width: 130px;
  background: linear-gradient(180deg, #f7fafc, #eef3f7);
  border-left: 2px dashed var(--line);
}
.pass-price { font-family: var(--mono); font-weight: 600; font-size: 22px; color: var(--ink); white-space: nowrap; }
.pass-price small { font-size: 12px; color: var(--muted); }
.badge {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
  padding: 3px 8px; border-radius: 20px;
}
.badge.cheap { background: var(--deal-bg); color: var(--deal); }
.badge.best { background: #eaf4ff; color: #1e5fa8; }
.offer-link {
  font-family: var(--sans); font-size: 12px; font-weight: 600;
  color: var(--accent-ink); text-decoration: none; margin-top: 4px; white-space: nowrap;
}
.offer-link:hover { text-decoration: underline; }

/* Destination + date tiles */
.tile {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 6px;
  cursor: pointer; transition: transform 0.12s ease, border-color 0.12s ease;
}
.tile:hover { transform: translateY(-2px); border-color: var(--accent); }
.tile .code { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.tile .place { font-family: var(--display); font-weight: 600; font-size: 19px; letter-spacing: -0.01em; }
.tile .price { font-family: var(--mono); font-weight: 600; font-size: 18px; color: var(--accent-ink); margin-top: 4px; }
.tile .sub { font-size: 12px; color: var(--muted); }

.foot {
  max-width: 1040px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 40px) 40px;
  color: var(--muted); font-size: 13px;
}

@media (max-width: 560px) {
  .field, .field--sm, .field--xs { flex: 1 1 100%; }
  .swap { display: none; }
  .pass { grid-template-columns: 1fr; }
  .pass-stub { border-left: 0; border-top: 2px dashed var(--line); flex-direction: row; justify-content: space-between; align-items: center; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
