/* ==========================================================================
   MY AUDI - VIRTUAL COCKPIT DESIGN SYSTEM
   Inspirado en la instrumentación digital y MMI de Audi Sport
   ========================================================================== */

:root {
  /* Paleta Base Audi Dark Theme */
  --bg-darkest: #07080b;
  --bg-card: rgba(17, 21, 31, 0.78);
  --bg-card-hover: rgba(23, 29, 44, 0.85);
  --bg-hud: rgba(14, 18, 27, 0.85);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(0, 194, 255, 0.4);
  --border-sport: rgba(225, 6, 0, 0.35);

  /* Acentos de Color */
  --audi-red: #e10600;
  --audi-red-glow: rgba(225, 6, 0, 0.35);
  --audi-cyan: #00c2ff;
  --audi-cyan-glow: rgba(0, 194, 255, 0.3);
  --audi-green: #00e676;
  --audi-green-glow: rgba(0, 230, 118, 0.25);
  --audi-amber: #ffab00;
  
  /* Textos */
  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  --text-glow: rgba(255, 255, 255, 0.95);

  /* Tipografías */
  --font-main: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-heading: 'Space Grotesk', -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Transiciones y sombras */
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  --shadow-card: 0 10px 30px -5px rgba(0, 0, 0, 0.6);
  --shadow-glow-red: 0 0 25px var(--audi-red-glow);
  --shadow-glow-cyan: 0 0 25px var(--audi-cyan-glow);
}

/* Reset y Base */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-darkest);
  color: var(--text-primary);
  line-height: 1.5;
  overflow-x: hidden;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* Fondo Dinámico con orbes de luz */
.cockpit-bg {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
  background: radial-gradient(circle at 50% 0%, #151a28 0%, #07080b 70%);
}

.glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.15;
}

.orb-red {
  top: -100px;
  right: 15%;
  width: 450px;
  height: 450px;
  background: var(--audi-red);
}

.orb-blue {
  bottom: 10%;
  left: 5%;
  width: 500px;
  height: 500px;
  background: var(--audi-cyan);
  opacity: 0.1;
}

.cockpit-grid-overlay {
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 40px 40px;
  opacity: 0.6;
}

/* Layout Contenedor */
.app-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 4rem;
}

/* ================= HEADER ================= */
.cockpit-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.25rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 1.5rem;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

/* Audi Rings Logo */
.audi-rings {
  display: flex;
  align-items: center;
}

.audi-rings .ring {
  width: 28px;
  height: 28px;
  border: 3px solid #e5e7eb;
  border-radius: 50%;
  margin-right: -9px;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.15);
  transition: var(--transition-fast);
}

.audi-rings:hover .ring {
  border-color: #fff;
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
}

.brand-titles {
  display: flex;
  flex-direction: column;
}

.brand-top {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.brand-name {
  font-family: var(--font-heading);
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  font-weight: 700;
  color: var(--text-secondary);
}

.sport-badge {
  background: var(--audi-red);
  color: #fff;
  font-family: var(--font-heading);
  font-size: 0.65rem;
  font-weight: 800;
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  letter-spacing: 0.1em;
}

.vehicle-title {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.02em;
}

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* Status Pill */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  transition: var(--transition-fast);
}

.status-live {
  border-color: rgba(0, 230, 118, 0.3);
  color: #72f5ab;
  background: rgba(0, 230, 118, 0.08);
}

.status-demo {
  border-color: rgba(255, 171, 0, 0.4);
  color: #ffc44d;
  background: rgba(255, 171, 0, 0.1);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 10px currentColor;
  animation: pulse-ring 1.8s infinite ease-in-out;
}

@keyframes pulse-ring {
  0% { transform: scale(0.9); opacity: 0.7; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.7; }
}

/* Mode Switch */
.mode-switch-wrapper {
  display: flex;
  background: rgba(255, 255, 255, 0.05);
  padding: 3px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
}

.btn-mode {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-main);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-mode.active {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.btn-mode:hover:not(.active) {
  color: #fff;
}

/* Icon Buttons */
.btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-icon:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-icon.spinning svg {
  animation: spin 1s infinite linear;
}

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

/* Cross Nav Links */
.cross-nav {
  display: flex;
  gap: 0.5rem;
  margin-left: 0.5rem;
}

.nav-chip {
  padding: 0.35rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  text-decoration: none;
  transition: var(--transition-fast);
}

.nav-chip:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.25);
}

/* ================= BANNER DE CONFIGURACIÓN ================= */
.config-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  background: linear-gradient(90deg, rgba(225, 6, 0, 0.12) 0%, rgba(17, 21, 31, 0.8) 100%);
  border: 1px solid var(--border-sport);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  backdrop-filter: blur(12px);
  animation: slide-down 0.4s ease-out;
}

@keyframes slide-down {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.banner-content {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.banner-icon {
  font-size: 1.5rem;
}

.banner-text strong {
  display: block;
  font-size: 0.95rem;
  color: #fff;
}

.banner-text p {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.btn-banner-action {
  background: var(--audi-red);
  color: #fff;
  font-family: var(--font-main);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-banner-action:hover {
  background: #ff1919;
  box-shadow: 0 0 15px var(--audi-red-glow);
}

/* ================= HUD BAR (RESUMEN RÁPIDO) ================= */
.quick-hud-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.hud-item {
  background: var(--bg-hud);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-card);
  transition: var(--transition-fast);
}

.hud-item:hover {
  border-color: rgba(255, 255, 255, 0.18);
  background: var(--bg-card-hover);
}

.hud-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
}

.hud-value-group {
  display: flex;
  align-items: baseline;
  gap: 0.3rem;
  margin-bottom: 0.35rem;
}

.hud-value {
  font-family: var(--font-mono);
  font-size: 1.85rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.02em;
}

.hud-unit {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.hud-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.hud-progress-bar {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 0.5rem;
}

.hud-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #ff7b00, #ffb300);
  border-radius: 3px;
  transition: width 0.6s ease-out;
}

.hud-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.8rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
  width: fit-content;
}

.badge-locked {
  background: rgba(0, 230, 118, 0.12);
  color: #00e676;
  border: 1px solid rgba(0, 230, 118, 0.3);
}

.badge-unlocked {
  background: rgba(225, 6, 0, 0.15);
  color: #ff3333;
  border: 1px solid rgba(225, 6, 0, 0.4);
}

/* Colores de Utilidad */
.text-cyan { color: var(--audi-cyan) !important; }
.text-green { color: var(--audi-green) !important; }
.text-red { color: var(--audi-red) !important; }
.font-mono { font-family: var(--font-mono); }

/* ================= TABS NAVIGATION ================= */
.cockpit-tabs {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  scrollbar-width: thin;
}

.tab-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  font-family: var(--font-main);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition-fast);
}

.tab-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.04);
}

.tab-btn.active {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
  color: #fff;
  box-shadow: inset 0 -2px 0 var(--audi-red);
}

/* ================= CONTENIDO DE PESTAÑAS ================= */
.tab-pane {
  display: none;
  animation: fade-in 0.3s ease-in-out;
}

.tab-pane.active {
  display: block;
}

@keyframes fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Tarjetas Base */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 1.5rem;
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-card);
  transition: var(--transition-smooth);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.card-tag {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
}

.card-sub-tag {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* ================= PESTAÑA 1: OVERVIEW ================= */
.overview-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 1.25rem;
}

.overview-grid > * {
  min-width: 0;
}

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

/* Vehicle Showcase Card */
.vehicle-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
  overflow: hidden;
}

.vin-chip {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  background: rgba(255, 255, 255, 0.06);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  color: var(--text-secondary);
}

.vehicle-visual {
  margin: 0.5rem 0 0.85rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.vehicle-silhouette-preview {
  width: 100%;
  max-width: 280px;
  height: 135px;
  margin: 0 auto 0.75rem;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.audi-q5-photo {
  max-width: 280px;
  max-height: 135px;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  margin: 0 auto;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.85));
  transition: transform var(--transition-smooth), filter var(--transition-smooth);
}

.audi-q5-photo:hover {
  transform: scale(1.03);
  filter: drop-shadow(0 14px 22px rgba(0, 0, 0, 0.95)) drop-shadow(0 0 15px rgba(225, 6, 0, 0.25));
}

.audi-q5-side-svg {
  width: 100%;
  height: auto;
  filter: drop-shadow(0 15px 25px rgba(0, 0, 0, 0.7));
}

.vehicle-model-name {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.5rem;
}

.spec-badges {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.spec-badge {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.vehicle-footer-info {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle);
}

.footer-item {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.f-label {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.f-val {
  font-size: 0.8rem;
  font-weight: 600;
  color: #fff;
}

/* Diales Circulares */
.dial-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.dial-container {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 0;
}

.circular-dial {
  position: relative;
  width: 170px;
  height: 170px;
}

.dial-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.dial-track {
  fill: none;
  stroke: rgba(255, 255, 255, 0.07);
  stroke-width: 10;
}

.dial-fill {
  fill: none;
  stroke-width: 10;
  stroke-linecap: round;
  stroke-dasharray: 427; /* 2 * PI * 68 */
  stroke-dashoffset: 427;
  transition: stroke-dashoffset 1s ease-in-out;
}

.dial-fill-fuel {
  stroke: #ff9800;
  filter: drop-shadow(0 0 6px rgba(255, 152, 0, 0.5));
}

.dial-fill-battery {
  stroke: var(--audi-green);
  filter: drop-shadow(0 0 6px rgba(0, 230, 118, 0.5));
}

.dial-inner {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.dial-main-val {
  font-family: var(--font-mono);
  font-size: 2.2rem;
  font-weight: 700;
  color: #fff;
  line-height: 1;
}

.dial-main-unit {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.dial-sub-text {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.dial-card-footer {
  display: flex;
  justify-content: space-between;
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle);
}

.mini-stat {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.m-label {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.m-val {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
}

/* ================= PESTAÑA 2: PUERTAS Y SEGURIDAD ================= */
.doors-view-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

@media (max-width: 900px) {
  .doors-view-grid {
    grid-template-columns: 1fr;
  }
}

.blueprint-card {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.doors-overall-badge {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--audi-green);
  background: rgba(0, 230, 118, 0.1);
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
}

.blueprint-container {
  width: 100%;
  max-width: 320px;
  padding: 1rem 0;
}

.audi-blueprint-svg {
  width: 100%;
  height: auto;
  filter: drop-shadow(0 15px 30px rgba(0, 0, 0, 0.8));
}

/* Zone Markers en el SVG */
.zone-marker {
  cursor: pointer;
  transition: transform var(--transition-fast);
}

.zone-marker:hover {
  transform: scale(1.15);
}

.marker-circle {
  transition: fill var(--transition-fast), stroke var(--transition-fast);
}

.marker-circle.ok {
  fill: #1a2538;
  stroke: var(--audi-green);
  stroke-width: 2.5;
}

.marker-circle.open {
  fill: #3b1414;
  stroke: var(--audi-red);
  stroke-width: 3;
  animation: pulse-ring 1.5s infinite;
}

.marker-text {
  fill: #fff;
  font-family: var(--font-heading);
  font-size: 8px;
  font-weight: 800;
  text-anchor: middle;
  pointer-events: none;
}

/* Columnas de detalle */
.doors-detail-column {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.item-status-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  transition: var(--transition-fast);
}

.status-row:hover {
  background: rgba(255, 255, 255, 0.05);
}

.row-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.row-icon {
  font-size: 1.1rem;
}

.row-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
}

.row-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
}

.badge-closed {
  background: rgba(0, 230, 118, 0.1);
  color: var(--audi-green);
  border: 1px solid rgba(0, 230, 118, 0.25);
}

.badge-open {
  background: rgba(225, 6, 0, 0.15);
  color: #ff4747;
  border: 1px solid rgba(225, 6, 0, 0.35);
}

/* ================= PESTAÑA 3: MANTENIMIENTO ================= */
.maint-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}

.maint-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.service-pill {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  background: rgba(0, 230, 118, 0.1);
  color: var(--audi-green);
  border: 1px solid rgba(0, 230, 118, 0.2);
}

.maint-main-stat {
  display: flex;
  align-items: center;
  justify-content: space-around;
  margin: 1.25rem 0;
  text-align: center;
}

.maint-stat-item {
  display: flex;
  flex-direction: column;
}

.m-big-num {
  font-family: var(--font-mono);
  font-size: 2.2rem;
  font-weight: 700;
  color: #fff;
}

.m-big-label {
  font-size: 0.7rem;
  color: var(--text-secondary);
  font-weight: 600;
  letter-spacing: 0.05em;
}

.maint-divider {
  width: 1px;
  height: 40px;
  background: var(--border-subtle);
}

.maint-progress-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.maint-progress-bar {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  overflow: hidden;
}

.maint-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--audi-cyan), #00e676);
  border-radius: 3px;
}

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

.card-explanation {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 0.5rem;
}

.lights-status-box {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 1rem;
}

.light-icon-box {
  font-size: 2rem;
}

.light-state-title {
  display: block;
  font-weight: 700;
  color: #fff;
  font-size: 0.95rem;
}

.light-state-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* ================= PESTAÑA 4: UBICACIÓN GPS ================= */
.location-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 1.5rem;
}

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

.location-info-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.gps-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  background: rgba(0, 194, 255, 0.1);
  color: var(--audi-cyan);
  border: 1px solid rgba(0, 194, 255, 0.3);
}

.loc-details {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin: 1.5rem 0;
}

.loc-row {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.loc-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
}

.loc-val {
  font-size: 0.9rem;
  color: #fff;
}

.map-actions {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.btn-map {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1rem;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  transition: var(--transition-fast);
}

.btn-google {
  background: rgba(66, 133, 244, 0.15);
  color: #8ab4f8;
  border: 1px solid rgba(66, 133, 244, 0.3);
}

.btn-google:hover {
  background: rgba(66, 133, 244, 0.25);
  color: #fff;
}

.btn-apple {
  background: rgba(255, 255, 255, 0.08);
  color: #e5e7eb;
  border: 1px solid var(--border-subtle);
}

.btn-apple:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.map-frame-card {
  position: relative;
  min-height: 380px;
  padding: 0;
  overflow: hidden;
}

.map-iframe {
  width: 100%;
  height: 100%;
  min-height: 380px;
  border: none;
  filter: contrast(1.1) brightness(0.9);
}

.map-overlay-attribution {
  position: absolute;
  bottom: 8px;
  right: 8px;
  font-size: 0.65rem;
  background: rgba(0, 0, 0, 0.7);
  padding: 2px 6px;
  border-radius: 4px;
  color: #aaa;
}

/* ================= PESTAÑA 5: DIAGNÓSTICO ================= */
.raw-telemetry-card {
  display: flex;
  flex-direction: column;
}

.btn-copy-raw {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-subtle);
  color: #fff;
  font-family: var(--font-main);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-copy-raw:hover {
  background: rgba(255, 255, 255, 0.16);
}

.json-code-box {
  background: #090b10;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 1.25rem;
  max-height: 480px;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: #8ed6fb;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-all;
}

/* ================= MODAL DE CONFIGURACIÓN ================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.modal-window {
  background: #111520;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  max-width: 620px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.9);
  animation: modal-pop 0.25s ease-out;
}

@keyframes modal-pop {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

.modal-pre {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--audi-red);
  letter-spacing: 0.1em;
}

.modal-title {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  color: #fff;
}

.modal-close-btn {
  background: transparent;
  border: none;
  font-size: 1.8rem;
  color: var(--text-secondary);
  cursor: pointer;
}

.modal-close-btn:hover {
  color: #fff;
}

.modal-body {
  padding: 1.5rem;
}

.modal-intro {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
}

.modal-tabs {
  display: flex;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 1.25rem;
}

.modal-tab-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-main);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  transition: var(--transition-fast);
}

.modal-tab-btn.active {
  color: #fff;
  box-shadow: inset 0 -2px 0 var(--audi-cyan);
}

.modal-tab-pane {
  display: none;
}

.modal-tab-pane.active {
  display: block;
}

/* Pasos de Guía */
.guide-steps {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.step-box {
  display: flex;
  gap: 1rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 1rem;
}

.step-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: var(--audi-red);
  color: #fff;
  font-weight: 700;
  border-radius: 50%;
  flex-shrink: 0;
  font-size: 0.85rem;
}

.step-text strong {
  display: block;
  font-size: 0.9rem;
  color: #fff;
  margin-bottom: 0.25rem;
}

.step-text p {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.code-snippet-box {
  background: #090a0f;
  padding: 0.6rem 0.8rem;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: #79c0ff;
  line-height: 1.5;
}

/* Device Code View */
.device-code-flow {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.btn-primary {
  background: var(--audi-red);
  color: #fff;
  font-family: var(--font-main);
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.7rem 1.25rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition-fast);
  width: fit-content;
}

.btn-primary:hover {
  background: #ff1919;
  box-shadow: 0 0 15px var(--audi-red-glow);
}

.device-code-result {
  background: rgba(0, 194, 255, 0.05);
  border: 1px solid var(--border-focus);
  border-radius: 12px;
  padding: 1.25rem;
  text-align: center;
}

.code-label {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  margin-bottom: 0.35rem;
}

.code-big {
  font-family: var(--font-mono);
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--audi-cyan);
  letter-spacing: 0.2em;
}

.code-instructions {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin: 0.75rem 0;
}

.btn-verify-link {
  display: inline-block;
  background: var(--audi-cyan);
  color: #07080b;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.6rem 1.2rem;
  border-radius: 6px;
  text-decoration: none;
  margin-bottom: 1rem;
  transition: var(--transition-fast);
}

.btn-verify-link:hover {
  background: #38d1ff;
  box-shadow: 0 0 15px var(--audi-cyan-glow);
}

.polling-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--audi-cyan);
  border-radius: 50%;
  animation: spin 0.8s infinite linear;
}

/* Formulario de prueba */
.test-conn-form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-group label {
  font-size: 0.78rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.form-input {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 0.6rem 0.85rem;
  color: #fff;
  font-family: var(--font-main);
  font-size: 0.85rem;
  transition: var(--transition-fast);
}

.form-input:focus {
  outline: none;
  border-color: var(--audi-cyan);
  box-shadow: 0 0 10px var(--audi-cyan-glow);
}

.test-console {
  background: #090a0f;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 0.85rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: #aaa;
  min-height: 80px;
  max-height: 150px;
  overflow-y: auto;
  white-space: pre-wrap;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: flex-end;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-subtle);
  color: #fff;
  font-family: var(--font-main);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* ================= RESPONSIVE ================= */
@media (max-width: 640px) {
  .vehicle-title {
    font-size: 1.35rem;
  }
  .hud-value {
    font-size: 1.5rem;
  }
  .maint-main-stat {
    flex-direction: column;
    gap: 1rem;
  }
  .maint-divider {
    display: none;
  }
}
