/* ==================================================================
   MotoFlow Optimizer — Sistema "Cyber-Tech" (modo oscuro)
   - Fondo       : #0B0F19
   - Superficies : #1E293B
   - Texto       : #F8FAFC
   - Acento      : #00F5D4  (SOLO boton "Alquilar ahora" / "Disponible")
   - Pesos 400/500/700 · radios 8px y 999px · elevation plana
=================================================================== */

:root {
  --bg: #0b0f19;
  --surface: #1e293b;
  --surface-hover: #263249;
  --text: #f8fafc;
  --text-muted: #94a3b8;
  --accent: #00f5d4;
  --accent-ink: #0b0f19;
  --border: rgba(248, 250, 252, 0.1);
  --radius: 8px;
  --radius-lg: 12px;
  --radius-pill: 999px;
  --shadow-float: 0 8px 24px rgba(0, 0, 0, 0.35);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, sans-serif;
  font-weight: 400;
  overflow: hidden;
}

h1,
h2,
h3,
.logo {
  font-family: "Space Grotesk", "Inter", sans-serif;
  font-weight: 700;
  letter-spacing: 0;
}

button {
  font-family: inherit;
}

.eyebrow {
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0;
  color: var(--accent);
}

.logo {
  font-size: 16px;
  color: var(--text);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.logo b {
  color: var(--accent);
}

/* ==================================================================
   BOTONES
=================================================================== */
.btn {
  display: inline-block;
  padding: 10px 18px;
  border: none;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.18s, opacity 0.18s, border-color 0.18s;
  text-align: center;
}

.btn-accent {
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
}

.btn-accent:hover {
  background: #00d9bb;
}

.btn-primary-lg {
  width: 100%;
  padding: 14px;
  border-radius: var(--radius-pill);
  background: var(--text);
  color: var(--bg);
  font-size: 16px;
  font-weight: 700;
}

.btn-primary-lg:hover {
  background: var(--accent);
  color: var(--accent-ink);
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-ghost-sm {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 12px;
  padding: 6px 12px;
}

.btn-disabled,
button:disabled {
  background: var(--surface);
  color: var(--text-muted);
  cursor: not-allowed;
  opacity: 0.6;
}

/* ==================================================================
   MARCADORES / BADGES
=================================================================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}

.badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.badge.ok {
  color: var(--accent);
  background: rgba(0, 245, 212, 0.12);
}

.badge.off {
  color: var(--text-muted);
  background: rgba(148, 163, 184, 0.12);
}

.badge.warn {
  color: var(--text);
  background: rgba(148, 163, 184, 0.2);
}

/* ==================================================================
   CARDS
=================================================================== */
.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.card-title {
  font-size: 15px;
  font-weight: 500;
}

.card-desc {
  font-size: 13px;
  color: var(--text-muted);
}

/* ==================================================================
   LANDING / PANTALLA DE ENTRADA (estructura estilo Bikago)
=================================================================== */
#menu {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: var(--bg);
  color: var(--text);
  overflow-y: auto;
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

#menu.menu-hidden {
  opacity: 0;
  transform: translateY(-14px);
  pointer-events: none;
}

.menu-scroll {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

@media (max-width: 720px) {
  .loc-pill,
  .land-nav-center {
    display: none;
  }
  .land-nav-links {
    justify-content: flex-end;
  }
}

/* ---- Nav sticky ---- */
.land-nav {
  position: sticky;
  top: 0;
  z-index: 1500;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
  margin: 0 -24px;
  padding-left: 24px;
  padding-right: 24px;
  background: rgba(11, 15, 25, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.land-nav-center {
  display: flex;
  align-items: center;
  gap: 8px;
}

.land-nav-links {
  display: flex;
  gap: 4px;
  flex: 1;
  justify-content: center;
}

.nav-link-land {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: var(--radius);
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s, background 0.15s;
}

.nav-link-land:hover {
  color: var(--accent);
  background: rgba(0, 245, 212, 0.1);
}

.select-mini {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius);
  padding: 7px 10px;
  font-size: 13px;
  font-family: inherit;
}

.loc-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius);
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 500;
}

.loc-pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 13px;
}

/* ---- Hero ---- */
.hero {
  padding: 56px 0 28px;
}

.hero .eyebrow {
  margin-bottom: 12px;
}

.hero h1 {
  font-size: clamp(34px, 6vw, 56px);
  line-height: 1.05;
}

.hero-sub {
  margin-top: 14px;
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.5;
  max-width: 560px;
}

/* ---- Widget de reserva ---- */
.widget {
  margin-top: 30px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  padding: 16px;
}

.widget-grid {
  display: grid;
  grid-template-columns: 1.4fr 1.2fr 1.6fr 1fr 1fr 0.9fr;
  gap: 12px;
  align-items: end;
}

.widget .field {
  margin-bottom: 0;
}

.link-btn {
  background: none;
  border: none;
  padding: 0;
  color: var(--accent);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  display: inline-block;
  margin-bottom: 6px;
  text-align: left;
}

.date-range {
  display: flex;
  gap: 6px;
}

input[type="date"] {
  color-scheme: dark;
}

.field-slider label {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.field-slider label b {
  color: var(--accent);
  font-weight: 500;
  font-size: 12px;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
  height: 28px;
}

.btn-search {
  height: 42px;
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.spinner {
  width: 15px;
  height: 15px;
  border: 2px solid rgba(11, 15, 25, 0.3);
  border-top-color: var(--accent-ink);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 1000px) {
  .widget-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 540px) {
  .widget-grid {
    grid-template-columns: 1fr;
  }
}

/* ---- Filtros pills ---- */
.filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 30px 0 18px;
}

.pill {
  padding: 8px 18px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.pill:hover {
  color: var(--text);
}

.pill.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

/* ---- Catálogo ---- */
.catalog {
  padding-bottom: 48px;
}

.card-img {
  aspect-ratio: 4 / 3;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #16233b, var(--surface));
  border: 1px dashed var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 12px;
  overflow: hidden;
}

.card-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 10px;
  transition: transform 0.3s ease;
}

.moto-card:hover .card-img img {
  transform: scale(1.08);
}

.moto-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
}

.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 6px;
}

.actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.icon-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius);
}

.icon-btn:hover {
  color: var(--accent);
}

/* ---- Locaciones ---- */
.locations {
  display: flex;
  flex-direction: column;
  gap: 32px;
  padding: 24px 0 56px;
}

.loc-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-areas: "txt img";
  gap: 32px;
  align-items: center;
}

.loc-row.flip {
  grid-template-areas: "img txt";
}

.loc-text {
  grid-area: txt;
}

.loc-img {
  grid-area: img;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #16233b, var(--surface));
  border: 1px dashed var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 13px;
}

.loc-text h2 {
  font-size: 26px;
}

.loc-text p {
  color: var(--text-muted);
  max-width: 420px;
  line-height: 1.6;
  margin: 10px 0 16px;
}

@media (max-width: 760px) {
  .loc-row,
  .loc-row.flip {
    grid-template-columns: 1fr;
    grid-template-areas: "txt" "img";
  }
}

/* ---- Calculadora ---- */
.calc {
  padding: 24px 0 56px;
}

.calc h2 {
  font-size: 26px;
  margin-bottom: 16px;
}

.calc-card {
  max-width: 520px;
}

.calc-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  font-size: 14px;
  color: var(--text-muted);
}

.calc-row span:last-child {
  color: var(--text);
  font-weight: 500;
  text-align: right;
}

.calc-row.total {
  border-top: 1px solid var(--border);
  margin-top: 6px;
  padding-top: 12px;
}

.calc-row.total span {
  color: var(--accent);
  font-weight: 700;
  font-size: 18px;
}

/* ==================================================================
   APP (navbar + main + footer)
=================================================================== */
#app {
  display: none;
  height: 100vh;
  flex-direction: column;
}

#app.active {
  display: flex;
}

.navbar {
  height: 64px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 20px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.nav-links {
  display: flex;
  gap: 4px;
  overflow-x: auto;
}

.nav-link {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: var(--radius);
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s, background 0.15s;
}

.nav-link:hover {
  color: var(--text);
}

.nav-link.active {
  color: var(--accent);
  background: rgba(0, 245, 212, 0.1);
}

.app-main {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  position: relative;
}

.view {
  display: none;
}

.view.active {
  display: block;
  min-height: 100%;
}

.page {
  max-width: 1080px;
  margin: 0 auto;
  padding: 48px 24px 64px;
}

.page-head {
  margin-bottom: 32px;
}

.page-head .eyebrow {
  margin-bottom: 8px;
}

.page-head h2 {
  font-size: 34px;
  line-height: 1.1;
  margin-bottom: 10px;
}

.page-sub {
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.5;
  max-width: 560px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

@media (max-width: 900px) {
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 560px) {
  .grid-3 {
    grid-template-columns: 1fr;
  }
}

.footer {
  flex-shrink: 0;
  border-top: 1px solid var(--border);
  background: var(--bg);
  padding: 18px 24px;
}

.footer-inner {
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  gap: 16px;
}

.footer-links a,
.footer-links span {
  cursor: pointer;
  color: inherit;
  text-decoration: none;
}

.footer-links a:hover,
.footer-links span:hover {
  color: var(--accent);
}

/* ==================================================================
   VISTA: MAPA
=================================================================== */
#view-map {
  position: relative;
  height: 100%;
}

#map {
  position: absolute;
  inset: 0;
}

.panel {
  position: absolute;
  top: 16px;
  left: 16px;
  width: 300px;
  max-width: calc(100% - 32px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-float);
  z-index: 1000;
}

.panel h2 {
  font-size: 16px;
  margin-bottom: 12px;
}

.field {
  margin-bottom: 10px;
}

.field label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 4px;
  color: var(--text-muted);
}

.field input,
.field select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: inherit;
  background: var(--bg);
  color: var(--text);
}

.field input[readonly] {
  cursor: pointer;
}

.panel .btn {
  width: 100%;
  margin-bottom: 6px;
}

.result {
  margin-top: 14px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

.result h3 {
  font-size: 14px;
  margin-bottom: 8px;
  color: var(--accent);
}

.result table {
  width: 100%;
  font-size: 13px;
}

.result td {
  padding: 3px 0;
  color: var(--text-muted);
}

.result td:last-child {
  text-align: right;
  color: var(--text);
  font-weight: 500;
}

.result .total td {
  border-top: 1px solid var(--border);
  padding-top: 8px;
  font-size: 15px;
  color: var(--accent);
  font-weight: 700;
}

.note {
  margin-top: 8px;
  font-size: 11px;
  color: var(--text-muted);
}

.hidden {
  display: none;
}

/* Marcadores y ruta (Leaflet) */
.moto-marker {
  width: 22px;
  height: 22px;
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  box-shadow: 0 0 10px rgba(0, 245, 212, 0.6);
}

/* ==================================================================
   VISTA: BUSCAR MOTO
=================================================================== */
.moto-card .btn {
  margin-top: 4px;
}

.moto-price {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.moto-price small {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-muted);
}

.moto-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

/* ==================================================================
   VISTA: MIS VIAJES
=================================================================== */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  padding: 64px 24px;
}

.empty-circle {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 1px dashed var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-size: 20px;
  margin-bottom: 10px;
}

.empty-state h3 {
  font-size: 20px;
}

.empty-state p {
  color: var(--text-muted);
  font-size: 14px;
  max-width: 380px;
}

.js-hint {
  color: var(--text-muted);
  font-size: 14px;
  padding: 24px 0;
  text-align: center;
}

/* ==================================================================
   VISTA: FLOTA
=================================================================== */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

table.flota {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 720px;
}

table.flota th {
  text-align: left;
  padding: 12px 16px;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 12px;
  border-bottom: 1px solid var(--border);
}

table.flota td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

table.flota tr:last-child td {
  border-bottom: none;
}

/* ==================================================================
   VISTA: ACERCA DEL PROYECTO
=================================================================== */
.about-section {
  margin-top: 32px;
}

.about-section h3 {
  font-size: 16px;
  margin-bottom: 10px;
}

.about-section p,
.about-section li {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.6;
}

.about-section ul {
  padding-left: 18px;
  margin-top: 6px;
}

.tech-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.chip {
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 12px;
  color: var(--text);
}

.chip.hot {
  border-color: var(--accent);
  color: var(--accent);
}

/* ==================================================================
   TOAST
=================================================================== */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  color: var(--text);
  padding: 12px 18px;
  border-radius: var(--radius);
  font-size: 13px;
  box-shadow: var(--shadow-float);
  z-index: 3000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  max-width: min(90vw, 460px);
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Boton Limpiar latiendo mientras hay un viaje activo */
@keyframes pulse-neon {
  0% {
    box-shadow: 0 0 0 0 rgba(0, 245, 212, 0.45);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(0, 245, 212, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(0, 245, 212, 0);
  }
}

.btn.pulse {
  animation: pulse-neon 1.6s ease-out infinite;
}