/* ═══════════════════════════════════════
   AutoTaxi BCN 2026 — style.css
   Aesthetic: Industrial / taxi dispatcher
   Dark, amber accents, monospace data
═══════════════════════════════════════ */

:root {
  --a: #F5A623;       /* amber */
  --a2: #c8841c;
  --ag: rgba(245,166,35,.13);
  --ag2: rgba(245,166,35,.06);
  --green: #27ae60;
  --red: #e74c3c;
  --orange: #e67e22;
  --blue: #2980b9;
  --bg:  #090909;
  --bg2: #0f0f0f;
  --bg3: #161616;
  --bg4: #1e1e1e;
  --bg5: #262626;
  --t:  #efefef;
  --t2: #888;
  --t3: #444;
  --b:  #1c1c1c;
  --brad: 12px;
  --font-ui: 'Sora', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --font-display: 'Bebas Neue', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { background: var(--bg); color: var(--t); font-family: var(--font-ui); min-height: 100vh; overflow-x: hidden; }
button { font-family: var(--font-ui); cursor: pointer; border: none; background: none; color: inherit; }
input { font-family: var(--font-ui); }

/* ─── SCREENS ─── */
.screen { display: none; flex-direction: column; min-height: 100vh; }
.screen.active { display: flex; }
.pb80 { height: 80px; }

/* ─── STATUS BAR ─── */
.status-bar {
  background: var(--bg2);
  border-bottom: 1px solid var(--b);
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  position: sticky; top: 0; z-index: 50;
  flex-shrink: 0;
}
.logo {
  font-family: var(--font-display);
  font-size: 20px;
  letter-spacing: 2px;
  color: var(--a);
  line-height: 1;
}
.logo-year { font-size: 12px; color: var(--t2); letter-spacing: 1px; }
.chips { display: flex; gap: 5px; align-items: center; flex-wrap: wrap; }
.chip {
  display: flex; align-items: center; gap: 4px;
  background: var(--bg3); border: 1px solid var(--b);
  border-radius: 20px; padding: 3px 9px;
  font-size: 11px; font-weight: 500; white-space: nowrap;
}
.chip-tariff { border-color: var(--a); color: var(--a); background: var(--ag2); }
.chip-time { color: var(--t2); }
.chip-zone { color: var(--t2); }
.chip-punta { border-color: var(--orange); color: var(--orange); background: rgba(230,126,34,.08); }

/* ─── SEARCH ─── */
.search-area { padding: 12px 14px 0; }
.search-box {
  background: var(--bg3); border: 1.5px solid var(--b);
  border-radius: var(--brad);
  display: flex; align-items: center; gap: 10px; padding: 0 14px;
  transition: border-color .2s;
}
.search-box:focus-within { border-color: var(--a); }
.search-ico { font-size: 18px; flex-shrink: 0; }
.search-input {
  flex: 1; background: none; border: none; color: var(--t);
  font-size: 17px; padding: 14px 0;
}
.search-input::placeholder { color: var(--t3); }
.search-input:focus { outline: none; }
.clear-btn {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--bg5); color: var(--t2);
  display: none; align-items: center; justify-content: center; font-size: 14px;
}
.clear-btn.show { display: flex; }

.origin-row {
  margin: 10px 0 0;
  background: var(--bg3); border: 1px solid var(--b);
  border-radius: var(--brad); padding: 11px 14px;
  display: flex; align-items: flex-start; gap: 10px;
}
.origin-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--green); flex-shrink: 0; margin-top: 3px;
}
.origin-dot.pulsing { animation: pulse .9s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.2} }
.origin-info { flex: 1; }
.origin-label { font-size: 10px; color: var(--t3); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 2px; }
.origin-addr { font-size: 13px; color: var(--t2); line-height: 1.3; }
.icon-btn {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--bg5); color: var(--t2); font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; border: 1px solid var(--b);
}

/* ─── TARIFF ALERT ─── */
.tariff-alert {
  margin: 10px 14px 0;
  padding: 9px 12px; border-radius: 8px;
  font-size: 12px; font-weight: 500;
  background: rgba(230,126,34,.12); border: 1px solid rgba(230,126,34,.4); color: var(--orange);
}

/* ─── AUTOCOMPLETE ─── */
.autocomplete {
  margin: 6px 14px 0;
  background: var(--bg3); border: 1px solid var(--b);
  border-radius: var(--brad); overflow: hidden; display: none;
  max-height: 280px; overflow-y: auto;
}
.autocomplete.show { display: block; }
.ac-item {
  padding: 12px 14px; border-bottom: 1px solid var(--b);
  cursor: pointer; transition: background .1s;
  display: flex; align-items: flex-start; gap: 10px;
}
.ac-item:last-child { border-bottom: none; }
.ac-item:active { background: var(--bg4); }
.ac-icon { font-size: 16px; margin-top: 1px; flex-shrink: 0; }
.ac-name { font-size: 14px; font-weight: 500; }
.ac-sub { font-size: 11px; color: var(--t2); margin-top: 2px; }
.ac-msg { padding: 16px; text-align: center; color: var(--t2); font-size: 13px; }

/* ─── QUICK SECTION ─── */
.quick-section { padding: 14px 14px 0; }
.quick-label { font-size: 10px; text-transform: uppercase; letter-spacing: 1.5px; color: var(--t3); margin-bottom: 10px; font-weight: 600; }
.quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.qcard {
  background: var(--bg3); border: 1.5px solid var(--b);
  border-radius: var(--brad); padding: 12px;
  cursor: pointer; transition: all .15s;
  display: flex; align-items: center; gap: 10px;
  position: relative;
}
.qcard:active { background: var(--bg4); transform: scale(.97); }
.qcard.is-fav { border-color: rgba(245,166,35,.3); }
.qcard-icon { font-size: 22px; flex-shrink: 0; }
.qc-name { font-size: 13px; font-weight: 600; }
.qc-sub { font-size: 10px; color: var(--t2); margin-top: 1px; }
.qcard-fav-btn {
  position: absolute; top: 6px; right: 6px;
  font-size: 14px; opacity: .4; transition: opacity .2s;
}
.qcard.is-fav .qcard-fav-btn { opacity: 1; }

/* ─── MAP ─── */
#map {
  height: 220px;
  flex-shrink: 0;
  z-index: 1;
  border-bottom: 2px solid var(--a);
}

/* ─── RESULT BODY ─── */
.result-body {
  flex: 1; overflow-y: auto;
  padding: 12px 14px 90px;
}

/* ─── FARE CARD ─── */
.fare-card {
  background: var(--bg3); border: 1.5px solid var(--a);
  border-radius: var(--brad); overflow: hidden;
  margin-bottom: 10px;
  box-shadow: 0 0 30px var(--ag);
}
.fare-header {
  background: var(--ag); padding: 14px 16px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--b);
}
.fare-dest { flex: 1; }
.fare-dest-label { font-size: 10px; color: var(--a2); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 3px; }
.fare-dest-name { font-size: 15px; font-weight: 600; line-height: 1.3; padding-right: 8px; }
.fare-price-block { text-align: right; flex-shrink: 0; }
.fare-total {
  font-family: var(--font-display);
  font-size: 54px; color: var(--a); line-height: 1; letter-spacing: 1px;
}
.fare-cents { font-size: 18px; }
.fare-body { padding: 12px 16px; }
.fare-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.pill {
  background: var(--bg4); border: 1px solid var(--b);
  border-radius: 20px; padding: 4px 10px; font-size: 11px;
}
.pill.hl { border-color: var(--a); color: var(--a); background: var(--ag2); }
.pill.toll { border-color: #c0392b; color: var(--red); background: rgba(231,76,60,.08); }
.pill.free { border-color: var(--green); color: var(--green); background: rgba(39,174,96,.08); }

/* ─── BREAKDOWN TABLE ─── */
.bd-table {
  border-top: 1px solid var(--b); padding-top: 10px; margin-top: 4px;
}
.bd-row {
  display: flex; justify-content: space-between; align-items: baseline;
  font-family: var(--font-mono); font-size: 11px; color: var(--t2); line-height: 2;
}
.bd-row.bd-sub { padding-left: 14px; font-size: 10px; color: var(--t3); }
.bd-row.bd-tot {
  color: var(--a); font-weight: 600;
  border-top: 1px dashed var(--b); margin-top: 4px; padding-top: 6px; font-size: 13px;
}
.bd-row.bd-warn { color: var(--red); font-size: 10px; }
.bd-label { flex: 1; }
.bd-val { flex-shrink: 0; text-align: right; }

/* ─── FREE ROUTE CARD ─── */
.free-card {
  background: var(--bg3); border: 1.5px solid var(--b);
  border-radius: var(--brad); overflow: hidden; margin-bottom: 10px;
  transition: border-color .2s;
}
.free-card.calculated { border-color: var(--green); }
.free-header {
  padding: 13px 16px; display: flex; align-items: center;
  justify-content: space-between;
}
.free-header-left { display: flex; align-items: center; gap: 10px; }
.free-title { font-size: 13px; font-weight: 600; }
.free-sub { font-size: 11px; color: var(--t2); margin-top: 2px; }
.free-price {
  font-family: var(--font-display);
  font-size: 36px; color: var(--green); line-height: 1;
}
.free-body { padding: 0 16px 14px; border-top: 1px solid var(--b); }
.free-detail { font-size: 11px; color: var(--t2); line-height: 1.8; font-family: var(--font-mono); margin-top: 10px; }
.calc-free-btn {
  background: var(--bg4); border: 1px solid var(--b); border-radius: 8px;
  color: var(--t2); font-size: 12px; font-weight: 600; padding: 8px 14px;
  flex-shrink: 0; white-space: nowrap;
}

/* ─── SUPPLEMENTS ─── */
.suppl-scroll {
  display: flex; gap: 7px; overflow-x: auto;
  padding-bottom: 4px; scrollbar-width: none; margin-bottom: 10px;
}
.suppl-scroll::-webkit-scrollbar { display: none; }
.stag {
  flex-shrink: 0; background: var(--bg3); border: 1.5px solid var(--b);
  border-radius: 20px; padding: 7px 12px; font-size: 12px;
  cursor: pointer; transition: all .15s;
  display: flex; align-items: center; gap: 5px; white-space: nowrap;
}
.stag:active { transform: scale(.95); }
.stag.on { border-color: var(--a); background: var(--ag2); color: var(--a); }
.stag .ck { font-size: 10px; display: none; }
.stag.on .ck { display: inline; }

/* ─── MANUAL PEAJE ─── */
.manual-row {
  background: var(--bg3); border: 1px solid var(--b);
  border-radius: var(--brad); padding: 10px 14px;
  display: flex; align-items: center; gap: 8px; margin-bottom: 10px;
}
.manual-label { font-size: 12px; color: var(--t2); flex-shrink: 0; }
.manual-input {
  flex: 1; background: none; border: none;
  border-bottom: 1px solid var(--b); color: var(--t);
  font-family: var(--font-mono); font-size: 15px;
  padding: 2px 0; text-align: right;
}
.manual-input:focus { outline: none; border-color: var(--a); }

/* ─── ACTION BUTTONS ─── */
.action-row { display: flex; gap: 8px; margin-bottom: 10px; }
.btn-primary {
  flex: 1; padding: 14px; border-radius: var(--brad);
  background: var(--a); color: #000;
  font-size: 14px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  letter-spacing: .3px;
}
.btn-primary:active { opacity: .85; }
.btn-secondary {
  flex: 1; padding: 14px; border-radius: var(--brad);
  background: var(--bg3); border: 1.5px solid var(--b);
  color: var(--t2); font-size: 14px; font-weight: 500;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-secondary:active { background: var(--bg4); }
.btn-back {
  width: 100%; padding: 13px; border-radius: var(--brad);
  background: var(--bg3); border: 1.5px solid var(--b);
  color: var(--t2); font-size: 14px; font-weight: 500;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin-bottom: 12px;
}
.btn-back:active { background: var(--bg4); }
.btn-danger {
  width: 100%; padding: 13px; border-radius: var(--brad);
  background: var(--bg3); border: 1.5px solid var(--b);
  color: var(--red); font-size: 13px; font-weight: 500;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  margin-top: 12px;
}

/* ─── NOTICE ─── */
.notice {
  background: #161008; border: 1px solid #4a3010;
  border-radius: 8px; padding: 8px 12px;
  font-size: 11px; color: #c8903a; margin-bottom: 10px; line-height: 1.5;
}
.notice strong { color: var(--a); }

/* ─── SECTION TITLE ─── */
.sec-title {
  font-size: 10px; text-transform: uppercase; letter-spacing: 1.5px;
  color: var(--t3); margin-bottom: 8px; font-weight: 600;
  display: flex; align-items: center; justify-content: space-between;
}
.sec-title-note { font-size: 9px; color: var(--t3); font-weight: 400; text-transform: none; letter-spacing: 0; }

/* ─── LIST BODY (fav/hist/stats) ─── */
.list-body { padding: 12px 14px 90px; flex: 1; overflow-y: auto; }

/* ─── CARD (generic list item) ─── */
.list-card {
  background: var(--bg3); border: 1px solid var(--b);
  border-radius: var(--brad); padding: 13px 14px;
  margin-bottom: 8px; display: flex; align-items: center; gap: 12px;
  cursor: pointer; transition: background .1s;
}
.list-card:active { background: var(--bg4); }
.list-card-icon { font-size: 20px; flex-shrink: 0; }
.list-card-text { flex: 1; min-width: 0; }
.list-card-title { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-card-sub { font-size: 11px; color: var(--t2); margin-top: 3px; display: flex; gap: 8px; flex-wrap: wrap; }
.list-card-right { flex-shrink: 0; text-align: right; }
.list-card-price {
  font-family: var(--font-mono); font-size: 18px;
  color: var(--a); font-weight: 600;
}
.list-card-price.real { color: var(--green); }
.list-card-price.estimated { color: var(--t2); font-size: 14px; }

/* COMPLETED trip badge */
.trip-status {
  font-size: 9px; padding: 2px 6px; border-radius: 4px;
  font-weight: 600; text-transform: uppercase; letter-spacing: .5px;
}
.trip-status.done { background: rgba(39,174,96,.15); color: var(--green); border: 1px solid rgba(39,174,96,.3); }
.trip-status.est  { background: var(--ag2); color: var(--a); border: 1px solid rgba(245,166,35,.2); }

/* ─── FAV CARD ACTIONS ─── */
.fav-actions { display: flex; gap: 6px; flex-shrink: 0; }
.fav-action-btn {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--bg5); border: 1px solid var(--b);
  display: flex; align-items: center; justify-content: center; font-size: 14px;
  color: var(--t2);
}

/* ─── STATS ─── */
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.stat-card {
  background: var(--bg3); border: 1px solid var(--b);
  border-radius: var(--brad); padding: 14px;
}
.stat-val {
  font-family: var(--font-display);
  font-size: 32px; color: var(--a); line-height: 1; margin-bottom: 4px;
}
.stat-val.green { color: var(--green); }
.stat-lbl { font-size: 10px; color: var(--t2); text-transform: uppercase; letter-spacing: 1px; }
.stats-month-selector {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--bg3); border: 1px solid var(--b);
  border-radius: var(--brad); padding: 10px 14px; margin-bottom: 14px;
}
.month-nav { width: 32px; height: 32px; border-radius: 8px; background: var(--bg4); color: var(--t); font-size: 16px; display: flex; align-items: center; justify-content: center; }
.month-label { font-size: 14px; font-weight: 600; }

/* ─── BOTTOM TABS ─── */
.bottom-tabs {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
  background: var(--bg2); border-top: 1px solid var(--b);
  display: flex;
}
.tab {
  flex: 1; padding: 9px 0 13px;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  font-size: 9px; color: var(--t3); font-weight: 600;
  letter-spacing: .5px; text-transform: uppercase; transition: color .15s;
}
.tab.active { color: var(--a); }
.tab-ico { font-size: 19px; line-height: 1; }
.tab-lbl { line-height: 1; }

/* ─── LOADING ─── */
.loading-overlay {
  position: fixed; inset: 0; background: rgba(9,9,9,.9);
  display: none; align-items: center; justify-content: center;
  flex-direction: column; gap: 14px; z-index: 200; backdrop-filter: blur(4px);
}
.loading-overlay.show { display: flex; }
.spinner {
  width: 44px; height: 44px;
  border: 3px solid var(--bg3); border-top-color: var(--a);
  border-radius: 50%; animation: spin .7s linear infinite;
}
.spinner-sm {
  width: 18px; height: 18px;
  border: 2px solid var(--bg4); border-top-color: var(--green);
  border-radius: 50%; animation: spin .6s linear infinite; flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { font-size: 14px; color: var(--t2); }

/* ─── TOAST ─── */
.toast {
  position: fixed; bottom: 75px; left: 50%; transform: translateX(-50%);
  border-radius: 10px; padding: 10px 18px; font-size: 13px;
  display: none; z-index: 300; white-space: nowrap;
  animation: toastin .2s ease;
}
.toast.show { display: block; }
.toast.err { background: #2d1b1b; border: 1px solid var(--red); color: var(--red); }
.toast.ok  { background: #0f2018; border: 1px solid var(--green); color: var(--green); }
.toast.info{ background: var(--bg3); border: 1px solid var(--b); color: var(--t); }
@keyframes toastin { from { opacity:0; bottom:65px; } to { opacity:1; bottom:75px; } }

/* ─── MODAL ─── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.78);
  display: none; align-items: flex-end; justify-content: center;
  z-index: 400; backdrop-filter: blur(5px);
}
.modal-overlay.show { display: flex; }
.modal-box {
  background: var(--bg2); border: 1px solid var(--b);
  border-radius: 20px 20px 0 0;
  padding: 20px 18px 32px;
  width: 100%; max-width: 480px;
  max-height: 85vh; overflow-y: auto;
}
.modal-title { font-size: 17px; font-weight: 700; margin-bottom: 6px; }
.modal-sub { font-size: 13px; color: var(--t2); margin-bottom: 18px; line-height: 1.5; }
.modal-field { margin-bottom: 14px; }
.modal-field label { font-size: 11px; color: var(--t2); text-transform: uppercase; letter-spacing: 1px; display: block; margin-bottom: 6px; }
.modal-input {
  width: 100%; background: var(--bg3); border: 1.5px solid var(--b);
  border-radius: 8px; color: var(--t); font-family: var(--font-ui);
  font-size: 15px; padding: 11px 12px;
}
.modal-input:focus { outline: none; border-color: var(--a); }
.modal-input.price-input {
  font-family: var(--font-mono); font-size: 22px; text-align: center; color: var(--green);
}
.modal-btns { display: flex; gap: 10px; margin-top: 4px; }
.modal-cancel {
  flex: 1; padding: 13px; border-radius: 10px;
  background: var(--bg4); color: var(--t2); font-size: 14px; font-weight: 500;
  border: 1px solid var(--b);
}
.modal-ok {
  flex: 1; padding: 13px; border-radius: 10px;
  background: var(--a); color: #000; font-size: 14px; font-weight: 700;
}
.modal-ok.danger { background: var(--red); color: #fff; }

/* ─── EMPTY STATE ─── */
.empty-state {
  text-align: center; padding: 60px 20px; color: var(--t3);
}
.empty-icon { font-size: 48px; margin-bottom: 14px; }
.empty-title { font-size: 16px; font-weight: 600; color: var(--t2); margin-bottom: 6px; }
.empty-sub { font-size: 13px; line-height: 1.6; }

/* ─── LIST COUNT ─── */
.list-count {
  font-size: 11px; color: var(--t3); text-align: right;
  margin-bottom: 10px; font-family: var(--font-mono);
}

/* ─── RESPONSIVE ─── */
@media (min-width: 480px) {
  .bottom-tabs, .loading-overlay, .modal-overlay, .toast {
    max-width: 480px; left: 50%; transform: translateX(-50%);
  }
  .toast { transform: translateX(-50%); }
}

/* ─── INFO SCREEN ─── */
.info-section { padding: 14px 0 6px; }
.info-header { font-family: var(--font-display); font-size: 24px; color: var(--a); letter-spacing: 1px; }
.info-sub { font-size: 11px; color: var(--t2); margin-top: 4px; }

.info-card {
  background: var(--bg3); border: 1px solid var(--b);
  border-radius: var(--brad); padding: 14px;
  margin-bottom: 10px;
}
.info-card-highlight {
  border-color: var(--a);
  background: var(--ag2);
}
.info-card-title {
  font-size: 13px; font-weight: 700;
  margin-bottom: 10px; color: var(--t);
}
.info-row {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12px; padding: 5px 0;
  border-bottom: 1px solid var(--b);
}
.info-row:last-of-type { border-bottom: none; }
.info-price {
  font-family: var(--font-mono); font-weight: 600; color: var(--a);
  flex-shrink: 0; margin-left: 8px;
}
.info-note {
  font-size: 11px; color: var(--t2); margin-top: 8px; line-height: 1.5;
  font-style: italic;
}
.info-big {
  font-size: 15px; font-weight: 700; color: var(--a);
  margin-bottom: 8px; line-height: 1.3;
}
.info-table {
  width: 100%; border-collapse: collapse;
  font-size: 12px; font-family: var(--font-mono);
}
.info-table th {
  color: var(--t2); font-weight: 600; padding: 4px 6px;
  text-align: right; border-bottom: 1px solid var(--b);
}
.info-table th:first-child { text-align: left; }
.info-table td {
  padding: 5px 6px; border-bottom: 1px solid var(--b);
  text-align: right; color: var(--t);
}
.info-table td:first-child { text-align: left; color: var(--t2); }
.info-table tr:last-child td { border-bottom: none; }

.info-tag {
  font-family: var(--font-display); font-size: 14px;
  padding: 2px 8px; border-radius: 6px; margin-right: 8px; flex-shrink: 0;
}
.info-tag.t1 { background: var(--ag); color: var(--a); }
.info-tag.t2 { background: rgba(231,76,60,.12); color: var(--red); }
.info-tag.t6 { background: rgba(41,128,185,.12); color: var(--blue); }
.info-tag.t7 { background: rgba(39,174,96,.12); color: var(--green); }
