/* ===============================
   TAXIPRO — ESTILOS GENERALES
=============================== */

:root {
  --bg-0: #07111d;
  --bg-1: #0b1724;
  --bg-2: #0f1f31;
  --surface: rgba(255, 255, 255, 0.05);
  --surface-strong: rgba(255, 255, 255, 0.08);
  --surface-soft: rgba(255, 255, 255, 0.03);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(214, 179, 106, 0.22);
  --text: #f4f7fb;
  --text-soft: rgba(255, 255, 255, 0.72);
  --text-muted: rgba(255, 255, 255, 0.5);
  --accent: #d6b36a;
  --accent-strong: #c69a43;
  --success: #34c759;
  --danger: #ff6b6b;
  --shadow-lg: 0 24px 70px rgba(0, 0, 0, 0.28);
  --shadow-md: 0 14px 40px rgba(0, 0, 0, 0.18);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 10px;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 50% 0%, rgba(214,179,106,0.09), transparent 22%),
    radial-gradient(circle at 0% 100%, rgba(255,255,255,0.04), transparent 20%),
    linear-gradient(180deg, var(--bg-0) 0%, var(--bg-1) 45%, var(--bg-2) 100%);
  min-height: 100vh;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

/* ===============================
   SPLASH PREMIUM RÁPIDO
=============================== */

#splash {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(circle at 50% 20%, rgba(214,179,106,0.14), transparent 20%),
    radial-gradient(circle at 15% 85%, rgba(255,255,255,0.05), transparent 20%),
    linear-gradient(160deg, #07111d 0%, #0b1f33 55%, #08131f 100%);
  color: #fff;
  opacity: 1;
  visibility: visible;
  transform: scale(1);
  transition:
    opacity 0.38s ease,
    visibility 0.38s ease,
    transform 0.38s ease;
}

#splash.splash-hidden {
  opacity: 0;
  visibility: hidden;
  transform: scale(1.01);
  pointer-events: none;
}

.splash-inner {
  width: min(100%, 420px);
  text-align: center;
  padding: 36px 24px 28px;
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(255,255,255,0.06) 0%, rgba(255,255,255,0.03) 100%);
  border: 1px solid rgba(255,255,255,0.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 24px 80px rgba(0,0,0,0.28);
  animation: splashEnter 0.42s ease-out;
}

#splash img,
.splash-logo {
  width: min(160px, 42vw);
  max-width: 160px;
  height: auto;
  object-fit: contain;
  margin-bottom: 18px;
  filter:
    drop-shadow(0 16px 36px rgba(0,0,0,0.28))
    drop-shadow(0 0 18px rgba(214,179,106,0.10));
}

.splash-title {
  font-size: clamp(1.9rem, 6vw, 2.8rem);
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #ffffff;
  margin: 0 0 8px;
  line-height: 1;
}

.splash-subtitle {
  margin: 0 auto;
  max-width: 280px;
  font-size: 0.95rem;
  line-height: 1.5;
  color: rgba(255,255,255,0.72);
}

.splash-loader {
  position: relative;
  width: min(220px, 64vw);
  height: 5px;
  margin: 22px auto 0;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255,255,255,0.10);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}

.splash-loader::before {
  content: "";
  position: absolute;
  inset: 0;
  width: 38%;
  border-radius: 999px;
  background: linear-gradient(90deg, #d6b36a 0%, #f0deb5 35%, #173f67 100%);
  animation: splashLoad 1.05s ease-in-out infinite;
}

.splash-footnote {
  margin-top: 16px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.42);
}

@keyframes splashEnter {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes splashLoad {
  0% {
    transform: translateX(-120%);
  }
  100% {
    transform: translateX(290%);
  }
}

/* ===============================
   HEADER
=============================== */

.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: linear-gradient(180deg, rgba(7,17,29,0.92), rgba(7,17,29,0.66));
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.logo {
  display: flex;
  align-items: center;
  min-height: 32px;
}

.logo img {
  display: block;
  height: 30px;
  width: auto;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-indicator {
  font-size: 0.95rem;
  color: var(--success);
  text-shadow: 0 0 10px rgba(52, 199, 89, 0.5);
}

.settings-btn {
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255,255,255,0.05);
  color: var(--text);
}

/* ===============================
   CONTENIDO PRINCIPAL
=============================== */

.main-container {
  width: 100%;
  max-width: 820px;
  margin: 0 auto;
  padding: 18px 14px 30px;
}

.card {
  display: grid;
  gap: 14px;
}

.app-section {
  position: relative;
  background: linear-gradient(180deg, rgba(255,255,255,0.055), rgba(255,255,255,0.03));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.app-section--result {
  border-color: var(--border-strong);
  background: linear-gradient(180deg, rgba(214,179,106,0.09), rgba(255,255,255,0.03));
}

.section-title {
  margin: 0 0 12px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

.section-inline-title {
  margin: 0 0 12px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
}

/* ===============================
   MAPA
=============================== */

.map-shell {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
  box-shadow: var(--shadow-lg);
  min-height: 250px;
}

#map {
  width: 100%;
  height: 320px;
  border-radius: var(--radius-lg);
  background: rgba(255,255,255,0.03);
}

.map-brand-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(7,17,29,0.82);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.08);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.map-brand-badge img {
  width: 18px;
  height: 18px;
}

.pilot-access-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  padding: 8px 12px;
  border: 1px solid rgba(214,179,106,0.24);
  border-radius: 999px;
  background: rgba(7,17,29,0.82);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

/* ===============================
   FORMULARIOS
=============================== */

.input-group {
  display: grid;
  gap: 8px;
}

.input-group label {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-soft);
}

input,
select {
  width: 100%;
  min-height: 50px;
  padding: 14px 14px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.06);
  color: var(--text);
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

input::placeholder {
  color: rgba(255,255,255,0.42);
}

input:focus,
select:focus {
  border-color: rgba(214,179,106,0.55);
  box-shadow: 0 0 0 4px rgba(214,179,106,0.10);
  background: rgba(255,255,255,0.08);
}

.origin-actions {
  display: flex;
  justify-content: flex-start;
}

/* ===============================
   BOTONES
=============================== */

button {
  min-height: 48px;
  border: 0;
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-weight: 700;
  transition: transform 0.14s ease, opacity 0.14s ease, box-shadow 0.18s ease, background 0.18s ease;
}

button:active {
  transform: scale(0.985);
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-primary,
#calculateBtn,
#startTripBtn,
#showClientMode,
#saveMeterBtn {
  background: linear-gradient(135deg, #d6b36a 0%, #b98935 100%);
  color: #111;
  box-shadow: 0 14px 30px rgba(214,179,106,0.20);
}

#calculateBtn {
  min-height: 56px;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.01em;
}

#calculateBtn:hover {
  box-shadow: 0 18px 34px rgba(214,179,106,0.28);
  transform: translateY(-1px);
}

.btn-secondary,
.location-btn,
#closeSettingsBtn {
  background: rgba(255,255,255,0.06);
  color: var(--text);
  border: 1px solid rgba(255,255,255,0.08);
}

#calculateBtn,
#startTripBtn,
#showClientMode,
#saveMeterBtn {
  width: 100%;
}

/* ===============================
   QUICK BUTTONS
=============================== */

#quickDestinations,
.quick-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

#quickDestinations button,
.quick-buttons button,
.supplement-btn {
  min-height: 42px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  color: var(--text);
  border: 1px solid rgba(255,255,255,0.08);
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: none;
}

#quickDestinations button:hover,
.quick-buttons button:hover,
.supplement-btn:hover {
  background: rgba(255,255,255,0.10);
}

.supplement-btn.active,
.supplement-btn[aria-pressed="true"] {
  background: rgba(214,179,106,0.18);
  border-color: rgba(214,179,106,0.42);
  color: #f6e2b8;
  box-shadow: inset 0 0 0 1px rgba(214,179,106,0.18);
}

/* ===============================
   SUPLEMENTOS
=============================== */

.supplements-panel {
  display: grid;
  gap: 12px;
}

.supplements-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
}

.supplements-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* ===============================
   LOADING
=============================== */

.loading-bar {
  position: relative;
  width: 100%;
  height: 6px;
  margin-top: 6px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255,255,255,0.08);
  display: none;
}

.loading-bar.active {
  display: block;
}

.loading-progress {
  width: 35%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #d6b36a 0%, #f0deb5 50%, #173f67 100%);
  animation: barMove 1s ease-in-out infinite;
}

@keyframes barMove {
  0% {
    transform: translateX(-120%);
  }
  100% {
    transform: translateX(320%);
  }
}

/* ===============================
   RESULTADO
=============================== */

.result-container {
  display: grid;
  gap: 14px;
}

.estimation-card {
  display: grid;
  gap: 10px;
  padding: 18px;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(214,179,106,0.11), rgba(255,255,255,0.04));
  border: 1px solid rgba(214,179,106,0.24);
  box-shadow: var(--shadow-md);
}

.estimation-title {
  font-size: 0.88rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.price {
  font-size: clamp(2.2rem, 7vw, 3.2rem);
  font-weight: 900;
  line-height: 1;
  color: #fff;
}

.interval {
  font-size: 1rem;
  font-weight: 700;
  color: rgba(255,255,255,0.82);
}

.route-meta {
  font-size: 0.96rem;
  color: var(--text-soft);
}

.traffic-status,
.confidence-indicator {
  font-size: 0.84rem;
  line-height: 1.45;
  color: var(--text-soft);
}

.legal-notice {
  margin: 0;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.78);
  font-size: 0.84rem;
  line-height: 1.5;
}

#meterInputSection {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: var(--radius-md);
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
}

#meterInputSection label {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-soft);
}

/* ===============================
   HISTORIAL Y PILOTO
=============================== */

.history-panel,
.pilot-stats {
  display: grid;
  gap: 8px;
  padding: 14px;
  border-radius: var(--radius-md);
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
}

.history-title,
.pilot-title {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--accent);
}

.pilot-hint {
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* ===============================
   MODO CLIENTE
=============================== */

.client-mode {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background:
    radial-gradient(circle at top, rgba(214,179,106,0.14), transparent 24%),
    rgba(4, 9, 16, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.client-card {
  width: min(100%, 560px);
  display: grid;
  gap: 16px;
  padding: 24px 20px;
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(14,27,43,0.96), rgba(8,17,28,0.98));
  border: 1px solid rgba(214,179,106,0.20);
  box-shadow: 0 30px 90px rgba(0,0,0,0.35);
  text-align: center;
}

.client-badge {
  display: inline-flex;
  justify-content: center;
  align-self: center;
  margin: 0 auto;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(214,179,106,0.14);
  border: 1px solid rgba(214,179,106,0.26);
  color: #f4ddb1;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.client-route {
  font-size: 1rem;
  line-height: 1.45;
  color: var(--text-soft);
}

.client-price {
  font-size: clamp(2.8rem, 10vw, 4.6rem);
  line-height: 1;
  font-weight: 900;
  color: #fff;
}

.client-price-label {
  font-size: 0.95rem;
  color: rgba(255,255,255,0.76);
}

.client-meta {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.client-meta-item {
  padding: 14px;
  border-radius: 16px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.06);
}

.meta-label {
  display: block;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.meta-value {
  font-size: 1.05rem;
  font-weight: 800;
  color: #fff;
}

.client-legal {
  font-size: 0.92rem;
  line-height: 1.55;
  color: rgba(255,255,255,0.82);
}

.client-close-btn {
  width: 100%;
  background: linear-gradient(135deg, #d6b36a 0%, #b98935 100%);
  color: #111;
}

/* ===============================
   MODAL CONFIGURACIÓN
=============================== */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 4000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(4, 9, 16, 0.84);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.modal-card {
  width: min(100%, 460px);
  padding: 22px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(14,27,43,0.98), rgba(8,17,28,0.98));
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 24px 80px rgba(0,0,0,0.3);
}

.modal-title {
  font-size: 1.1rem;
  font-weight: 800;
  margin-bottom: 18px;
  color: #fff;
}

.modal-field {
  display: grid;
  gap: 8px;
}

.modal-field label {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--text-soft);
}

.modal-hint {
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--text-muted);
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

.modal-actions button {
  flex: 1;
}

/* ===============================
   RECORDATORIO TAXÍMETRO
=============================== */

.meter-reminder {
  position: fixed;
  left: 14px;
  right: 14px;
  bottom: 14px;
  z-index: 2500;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(10, 20, 32, 0.92);
  border: 1px solid rgba(214,179,106,0.18);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.reminder-content {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.reminder-icon {
  font-size: 1rem;
}

.reminder-text {
  font-size: 0.88rem;
  line-height: 1.35;
  color: var(--text-soft);
}

.reminder-btn {
  min-height: 42px;
  white-space: nowrap;
  background: linear-gradient(135deg, #d6b36a 0%, #b98935 100%);
  color: #111;
}

/* ===============================
   RESPONSIVE
=============================== */

@media (max-width: 640px) {
  .main-container {
    padding: 14px 12px 26px;
  }

  .app-section {
    padding: 14px;
  }

  #map {
    height: 280px;
  }

  .client-card {
    padding: 22px 16px;
    border-radius: 24px;
  }

  .client-meta {
    grid-template-columns: 1fr;
  }

  .modal-actions {
    flex-direction: column;
  }

  .meter-reminder {
    flex-direction: column;
    align-items: stretch;
  }

  .reminder-btn {
    width: 100%;
  }

  .splash-inner {
    padding: 30px 20px 24px;
    border-radius: 24px;
  }

  .splash-title {
    font-size: 1.9rem;
  }

  .splash-subtitle {
    font-size: 0.9rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .splash-inner,
  .splash-loader::before,
  .loading-progress,
  #splash,
  button,
  input,
  select {
    animation: none !important;
    transition: none !important;
  }
}
/* Separador premium entre bloques */
.app-section + .app-section::before {
  content: "";
  position: absolute;
  top: -8px;
  left: 18px;
  right: 18px;
  height: 8px;
  pointer-events: none;
  background:
    linear-gradient(
      to bottom,
      rgba(214,179,106,0.22) 0px,
      rgba(214,179,106,0.22) 1px,
      transparent 1px,
      transparent 4px,
      rgba(255,255,255,0.10) 4px,
      rgba(255,255,255,0.10) 5px,
      transparent 5px,
      transparent 8px
    );
  opacity: 0.9;
}
.client-legal {
  display: grid;
  gap: 12px;
  text-align: left;
  padding: 14px;
  border-radius: 16px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.07);
  font-size: 0.88rem;
  line-height: 1.5;
  color: rgba(255,255,255,0.84);
}

.client-legal-block {
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.client-legal-block:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

.client-legal-block strong {
  display: inline-block;
  margin-bottom: 4px;
  color: #d6b36a;
  letter-spacing: 0.06em;
}
.result-container {
  display: grid;
  gap: 14px;
}

.result-container.show-result {
  animation: resultReveal 0.34s ease-out;
}

@keyframes resultReveal {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
.app-section--result {
  border-color: rgba(214,179,106,0.30);
  box-shadow: 0 18px 50px rgba(0,0,0,0.22);
}

.price {
  text-shadow: 0 6px 24px rgba(0,0,0,0.22);
}
.client-card {
  position: relative;
  overflow: hidden;
}

.client-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 8%;
  right: 8%;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(214,179,106,0.10) 15%,
    rgba(214,179,106,0.55) 50%,
    rgba(214,179,106,0.10) 85%,
    transparent 100%
  );
}

.client-price {
  text-shadow: 0 10px 34px rgba(0,0,0,0.28);
}

.client-price-label {
  font-size: 1rem;
  font-weight: 700;
  color: rgba(255,255,255,0.86);
}

.client-route {
  max-width: 420px;
  margin: 0 auto;
}