/* ==========================================================================
   AcoustiCar AI™ - Commercial Vehicle Acoustic Diagnostics Platform
   Aesthetic: Dark Modern Cyber-Cockpit / High-Tech Automotive Telemetry
   ========================================================================== */

:root {
  --bg-primary: #07090e;
  --bg-secondary: #0d121c;
  --bg-card: rgba(15, 22, 36, 0.78);
  --bg-card-hover: rgba(22, 32, 52, 0.88);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-active: rgba(0, 242, 254, 0.45);
  --border-glow: 0 0 20px rgba(0, 242, 254, 0.25);

  --accent-cyan: #00f2fe;
  --accent-blue: #4facfe;
  --accent-purple: #8a2be2;
  --accent-amber: #ffaa00;
  --accent-danger: #ff2a5f;
  --accent-success: #00f5a0;
  --accent-neutral: #8ba1b8;

  --text-main: #f0f4f8;
  --text-muted: #8ba1b8;
  --text-dim: #546577;

  --font-display: 'Space Grotesk', 'Outfit', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --font-body: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --shadow-card: 0 12px 36px -8px rgba(0, 0, 0, 0.65);
  --shadow-glow: 0 0 24px rgba(0, 242, 254, 0.35);
  --shadow-danger: 0 0 24px rgba(255, 42, 95, 0.35);
  --transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

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

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

/* Background Grid & Ambient Lighting */
.ambient-glow {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.glow-circle-1 {
  position: absolute;
  top: -15%;
  left: 15%;
  width: 650px;
  height: 650px;
  background: radial-gradient(circle, rgba(0, 242, 254, 0.12) 0%, transparent 70%);
  filter: blur(80px);
}

.glow-circle-2 {
  position: absolute;
  bottom: 5%;
  right: 5%;
  width: 750px;
  height: 750px;
  background: radial-gradient(circle, rgba(138, 43, 226, 0.1) 0%, transparent 70%);
  filter: blur(100px);
}

.glow-grid {
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(to right, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 40px 40px;
  opacity: 0.7;
}

/* Application Shell */
.app-container {
  position: relative;
  z-index: 1;
  max-width: 1440px;
  margin: 0 auto;
  padding: 1.25rem 1.5rem 3rem;
}

/* Top Navigation Bar */
.top-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 1.4rem;
  background: rgba(13, 18, 28, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  margin-bottom: 1.75rem;
  box-shadow: var(--shadow-card);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
  color: var(--text-main);
}

.brand-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #000;
  font-size: 1.25rem;
  box-shadow: 0 0 16px rgba(0, 242, 254, 0.45);
}

.brand-text h1 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  background: linear-gradient(90deg, #fff, var(--accent-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-text span {
  font-size: 0.72rem;
  color: var(--accent-cyan);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-family: var(--font-mono);
  display: block;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nav-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  background: rgba(0, 242, 254, 0.1);
  border: 1px solid rgba(0, 242, 254, 0.3);
  color: var(--accent-cyan);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
}

.nav-badge .pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-cyan);
  box-shadow: 0 0 8px var(--accent-cyan);
  animation: pulse 1.8s infinite;
}

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

.btn-nav-action {
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: var(--transition);
}

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

.btn-nav-action.highlight {
  background: linear-gradient(135deg, rgba(0, 242, 254, 0.2), rgba(138, 43, 226, 0.2));
  border-color: rgba(0, 242, 254, 0.4);
  color: var(--accent-cyan);
}

.btn-nav-action.highlight:hover {
  background: linear-gradient(135deg, rgba(0, 242, 254, 0.35), rgba(138, 43, 226, 0.35));
  box-shadow: 0 0 16px rgba(0, 242, 254, 0.3);
}

/* Hero Section */
.hero-banner {
  display: grid;
  grid-template-columns: 1.25fr 0.95fr;
  gap: 2rem;
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 2.25rem;
  margin-bottom: 2rem;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.hero-banner::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-cyan), var(--accent-purple), transparent);
}

.hero-content h2 {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 0.85rem;
  letter-spacing: -0.5px;
}

.hero-content h2 span {
  background: linear-gradient(120deg, var(--accent-cyan), #fff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-desc {
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
  max-width: 580px;
}

.hero-stats {
  display: flex;
  gap: 1.75rem;
  flex-wrap: wrap;
}

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

.stat-value {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
}

.stat-value.cyan { color: var(--accent-cyan); text-shadow: 0 0 12px rgba(0, 242, 254, 0.4); }
.stat-value.amber { color: var(--accent-amber); text-shadow: 0 0 12px rgba(255, 170, 0, 0.4); }
.stat-value.green { color: var(--accent-success); text-shadow: 0 0 12px rgba(0, 245, 160, 0.4); }

.stat-label {
  font-size: 0.78rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.hero-image-wrap {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid rgba(0, 242, 254, 0.3);
  box-shadow: 0 0 30px rgba(0, 242, 254, 0.2);
}

.hero-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s ease;
}

.hero-image-wrap:hover img {
  transform: scale(1.03);
}

.hero-tag {
  position: absolute;
  bottom: 12px;
  right: 12px;
  background: rgba(7, 9, 14, 0.85);
  backdrop-filter: blur(10px);
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--accent-cyan);
  border: 1px solid rgba(0, 242, 254, 0.3);
}

/* Vehicle Profile Input Bar */
.vehicle-selector-bar {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-card);
}

.vehicle-input-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.3fr;
  gap: 1rem;
  width: 100%;
}

.input-item {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.input-item label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.input-item label i {
  color: var(--accent-cyan);
}

.veh-text-input {
  background: rgba(7, 10, 16, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.85rem;
  color: #fff;
  font-family: inherit;
  font-size: 16px; /* Prevents iOS Safari auto-zoom */
  transition: var(--transition);
}

.veh-text-input:focus {
  outline: none;
  border-color: var(--accent-cyan);
  box-shadow: 0 0 10px rgba(0, 242, 254, 0.2);
}

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

@media (max-width: 580px) {
  .vehicle-input-grid {
    grid-template-columns: 1fr;
  }
}

/* Main Studio Layout: 2 Columns */
.diagnostic-studio {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 2rem;
  margin-bottom: 2.5rem;
}

/* Left Panel: Telemetry & Capture Console */
.telemetry-console {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.card-panel {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
  position: relative;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 0.75rem;
}

.panel-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: #fff;
}

.panel-title i {
  color: var(--accent-cyan);
}

.viz-tabs {
  display: flex;
  gap: 0.35rem;
  background: rgba(0, 0, 0, 0.35);
  padding: 0.25rem;
  border-radius: var(--radius-sm);
}

.viz-tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.75rem;
  padding: 0.3rem 0.65rem;
  border-radius: 4px;
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font-mono);
}

.viz-tab-btn.active {
  background: rgba(0, 242, 254, 0.2);
  color: var(--accent-cyan);
  font-weight: 600;
}

/* Canvas Spectrum Screen */
.visualizer-screen {
  position: relative;
  width: 100%;
  height: 250px;
  background: #05070a;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid rgba(0, 242, 254, 0.2);
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.9);
}

.visualizer-screen canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.screen-overlay {
  position: absolute;
  top: 10px;
  left: 12px;
  right: 12px;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: rgba(0, 242, 254, 0.75);
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(0, 0, 0, 0.65);
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  border: 1px solid rgba(0, 242, 254, 0.25);
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-neutral);
}

.status-dot.active {
  background: var(--accent-cyan);
  box-shadow: 0 0 6px var(--accent-cyan);
}

.status-dot.recording {
  background: var(--accent-danger);
  box-shadow: 0 0 8px var(--accent-danger);
  animation: pulse 1s infinite;
}

/* Audio Controls & Recording Bar */
.capture-controls {
  margin-top: 1.25rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.btn-record {
  grid-column: span 2;
  padding: 1.1rem 1.5rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(0, 242, 254, 0.4);
  background: linear-gradient(135deg, rgba(0, 242, 254, 0.25), rgba(79, 172, 254, 0.15));
  color: #fff;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 20px rgba(0, 242, 254, 0.2);
}

.btn-record:hover {
  background: linear-gradient(135deg, rgba(0, 242, 254, 0.35), rgba(79, 172, 254, 0.25));
  border-color: var(--accent-cyan);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

.btn-record.recording {
  background: linear-gradient(135deg, rgba(255, 42, 95, 0.4), rgba(255, 94, 0, 0.25));
  border-color: var(--accent-danger);
  box-shadow: var(--shadow-danger);
  animation: borderBlink 1.4s infinite;
}

@keyframes borderBlink {
  0%, 100% { border-color: var(--accent-danger); box-shadow: 0 0 15px rgba(255, 42, 95, 0.3); }
  50% { border-color: #ff8ca3; box-shadow: 0 0 25px rgba(255, 42, 95, 0.7); }
}

.btn-file-upload {
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 0.88rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: var(--transition);
}

.btn-file-upload:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-stop-audio {
  padding: 0.75rem 1rem;
  background: rgba(255, 42, 95, 0.08);
  border: 1px solid rgba(255, 42, 95, 0.2);
  border-radius: var(--radius-md);
  color: #ff7695;
  font-size: 0.88rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: var(--transition);
}

.btn-stop-audio:hover {
  background: rgba(255, 42, 95, 0.18);
  color: #fff;
  border-color: var(--accent-danger);
}

/* Telemetry Metrics Grid */
.telemetry-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.metric-box {
  background: rgba(7, 10, 16, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.85rem;
  display: flex;
  flex-direction: column;
}

.metric-title {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-bottom: 0.35rem;
  display: flex;
  justify-content: space-between;
}

.metric-val {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
}

.metric-unit {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: normal;
  margin-left: 2px;
}

/* Sound Simulation Benchmark Lab */
.simulator-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.sim-notice {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.45;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  background: rgba(0, 242, 254, 0.05);
  border-left: 3px solid var(--accent-cyan);
}

.soundboard-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.85rem;
}

.sound-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.9rem 1rem;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  text-align: left;
  position: relative;
  overflow: hidden;
}

.sound-card:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.18);
  transform: translateY(-2px);
}

.sound-card.active {
  background: rgba(0, 242, 254, 0.1);
  border-color: var(--accent-cyan);
  box-shadow: 0 0 16px rgba(0, 242, 254, 0.2);
}

.sound-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sound-title {
  font-weight: 600;
  font-size: 0.92rem;
  color: #fff;
}

.sound-badge {
  font-size: 0.65rem;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  font-family: var(--font-mono);
  font-weight: 600;
  text-transform: uppercase;
}

.sound-badge.danger { background: rgba(255, 42, 95, 0.2); color: var(--accent-danger); border: 1px solid rgba(255, 42, 95, 0.3); }
.sound-badge.warning { background: rgba(255, 170, 0, 0.2); color: var(--accent-amber); border: 1px solid rgba(255, 170, 0, 0.3); }
.sound-badge.moderate { background: rgba(79, 172, 254, 0.2); color: var(--accent-blue); border: 1px solid rgba(79, 172, 254, 0.3); }
.sound-badge.safe { background: rgba(0, 245, 160, 0.2); color: var(--accent-success); border: 1px solid rgba(0, 245, 160, 0.3); }

.sound-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.sound-play-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--accent-cyan);
  margin-top: 0.2rem;
}

/* Right Panel: Diagnosis & Business Intelligence */
.diagnostic-report-panel {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Result Card */
.result-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
}

.result-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--accent-cyan);
}

.result-card.status-danger::before { background: var(--accent-danger); }
.result-card.status-warning::before { background: var(--accent-amber); }
.result-card.status-safe::before { background: var(--accent-success); }

.result-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.result-fault-title {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.35rem;
}

.result-fault-eng {
  font-size: 0.85rem;
  color: var(--accent-cyan);
  font-family: var(--font-mono);
}

.confidence-gauge-box {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.confidence-val {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--accent-cyan);
  line-height: 1;
}

.confidence-label {
  font-size: 0.72rem;
  color: var(--text-dim);
  text-transform: uppercase;
}

.severity-banner {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 600;
  font-size: 0.92rem;
  margin-bottom: 1.25rem;
}

.severity-banner.danger {
  background: rgba(255, 42, 95, 0.15);
  border: 1px solid rgba(255, 42, 95, 0.4);
  color: #ff688c;
}

.severity-banner.warning {
  background: rgba(255, 170, 0, 0.15);
  border: 1px solid rgba(255, 170, 0, 0.4);
  color: #ffbe40;
}

.severity-banner.moderate {
  background: rgba(79, 172, 254, 0.15);
  border: 1px solid rgba(79, 172, 254, 0.4);
  color: #6bb9ff;
}

.severity-banner.safe {
  background: rgba(0, 245, 160, 0.15);
  border: 1px solid rgba(0, 245, 160, 0.4);
  color: #27f5aa;
}

.analysis-breakdown {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.breakdown-row {
  display: flex;
  gap: 0.85rem;
  font-size: 0.92rem;
}

.breakdown-label {
  min-width: 140px;
  color: var(--text-dim);
  font-weight: 500;
}

.breakdown-val {
  color: var(--text-main);
  flex: 1;
}

/* Parts & Cost Estimator */
.parts-box {
  background: rgba(8, 12, 20, 0.75);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.parts-box-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.parts-table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 1rem;
}

.parts-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.parts-table th {
  text-align: left;
  color: var(--text-dim);
  font-weight: 500;
  padding: 0.5rem 0.4rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.parts-table td {
  padding: 0.65rem 0.4rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.parts-table tr:last-child td {
  border-bottom: none;
  font-weight: 600;
  color: #fff;
}

.affiliate-buy-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #ff5722, #ff8f00);
  color: #fff;
  font-weight: 600;
  font-size: 0.92rem;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  box-shadow: 0 4px 15px rgba(255, 87, 34, 0.3);
}

.affiliate-buy-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 87, 34, 0.5);
}

/* Mechanic Script Box (Prevent rip-off) */
.mechanic-script-box {
  background: rgba(0, 242, 254, 0.03);
  border: 1px dashed rgba(0, 242, 254, 0.35);
  border-radius: var(--radius-md);
  padding: 1.15rem;
  margin-bottom: 1.5rem;
  position: relative;
}

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

.script-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.btn-copy-script {
  background: rgba(0, 242, 254, 0.15);
  border: 1px solid rgba(0, 242, 254, 0.3);
  color: var(--accent-cyan);
  padding: 0.3rem 0.65rem;
  border-radius: 4px;
  font-size: 0.74rem;
  cursor: pointer;
  transition: var(--transition);
}

.btn-copy-script:hover {
  background: rgba(0, 242, 254, 0.3);
  color: #fff;
}

.script-content {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
  font-style: italic;
  background: rgba(0, 0, 0, 0.2);
  padding: 0.75rem;
  border-radius: var(--radius-sm);
}

/* Lead Generation: Partner Garages */
.garages-box {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}

.garage-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-top: 1rem;
}

.garage-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 1rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: var(--transition);
}

.garage-item:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.15);
}

.garage-info h4 {
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 0.2rem;
}

.garage-meta {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.garage-meta .star {
  color: var(--accent-amber);
}

.btn-book-garage {
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius-sm);
  background: rgba(0, 242, 254, 0.12);
  border: 1px solid rgba(0, 242, 254, 0.3);
  color: var(--accent-cyan);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.btn-book-garage:hover {
  background: var(--accent-cyan);
  color: #000;
}

/* Export / Health Certificate Action */
.action-bar {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
}

.btn-export-cert {
  flex: 1;
  padding: 0.9rem 1.25rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  transition: var(--transition);
}

.btn-export-cert:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
}

/* Modal System (Generic) */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content-card {
  width: 100%;
  max-width: 680px;
  background: #0d121c;
  border: 1px solid rgba(0, 242, 254, 0.3);
  border-radius: var(--radius-lg);
  padding: 2.25rem;
  box-shadow: 0 0 50px rgba(0, 242, 254, 0.2);
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-close-btn {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  transition: var(--transition);
}

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

/* Certificate Modal Specific */
.cert-card {
  border: 2px solid var(--accent-cyan);
}

.cert-header {
  text-align: center;
  border-bottom: 2px solid rgba(0, 242, 254, 0.3);
  padding-bottom: 1.5rem;
  margin-bottom: 1.75rem;
}

.cert-header h3 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: #fff;
  letter-spacing: 1px;
}

.cert-header p {
  color: var(--accent-cyan);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  margin-top: 0.25rem;
}

.cert-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
  margin-bottom: 2rem;
  font-size: 0.9rem;
}

.cert-field {
  display: flex;
  flex-direction: column;
}

.cert-field label {
  font-size: 0.72rem;
  color: var(--text-dim);
  text-transform: uppercase;
}

.cert-field span {
  font-family: var(--font-mono);
  font-weight: 600;
  color: #fff;
  margin-top: 0.2rem;
}

.cert-stamp {
  margin: 1.5rem auto 0;
  padding: 0.75rem 2rem;
  display: inline-block;
  border: 3px double var(--accent-success);
  border-radius: var(--radius-sm);
  color: var(--accent-success);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  text-transform: uppercase;
  transform: rotate(-3deg);
  letter-spacing: 2px;
}

.cert-stamp.fail {
  border-color: var(--accent-danger);
  color: var(--accent-danger);
}

.cert-footer-actions {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
}

.btn-print {
  flex: 1;
  padding: 0.85rem 1rem;
  background: var(--accent-cyan);
  color: #000;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

/* Pricing SaaS Modal */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.pricing-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.5rem 1.25rem;
  display: flex;
  flex-direction: column;
  position: relative;
}

.pricing-card.popular {
  border-color: var(--accent-cyan);
  background: rgba(0, 242, 254, 0.05);
  box-shadow: 0 0 20px rgba(0, 242, 254, 0.15);
}

.pricing-card-badge {
  position: absolute;
  top: -10px;
  right: 15px;
  background: var(--accent-cyan);
  color: #000;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-full);
}

.pricing-plan-name {
  font-weight: 600;
  font-size: 1.1rem;
  color: #fff;
  margin-bottom: 0.25rem;
}

.pricing-price {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--accent-cyan);
  margin-bottom: 1rem;
}

.pricing-features {
  list-style: none;
  font-size: 0.82rem;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-bottom: 1.5rem;
  flex: 1;
}

.pricing-features li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pricing-features li i {
  color: var(--accent-success);
}

.btn-pricing-select {
  padding: 0.65rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition);
}

.btn-pricing-select:hover {
  background: var(--accent-cyan);
  color: #000;
}

/* Garage Signup Form */
.form-group {
  margin-bottom: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-group label {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.form-input {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  color: #fff;
  font-family: inherit;
  font-size: 16px; /* Prevents iOS Safari auto-zoom */
}

.form-input:focus {
  outline: none;
  border-color: var(--accent-cyan);
}

.btn-submit-form {
  width: 100%;
  padding: 0.9rem;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
  border: none;
  border-radius: var(--radius-md);
  color: #000;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  margin-top: 0.5rem;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: rgba(13, 18, 28, 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid var(--accent-cyan);
  color: #fff;
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  animation: slideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ==========================================================================
   Comprehensive Responsive System & Mobile-First Device Cockpit
   Tested for iPhone (SE, 12-16 Pro Max), Android (Galaxy, Pixel), Tablets, iPad
   ========================================================================== */

/* Universal touch targets & iOS zoom prevention */
input, select, textarea {
  font-size: 16px !important;
}

@media (max-width: 1200px) {
  .app-container {
    max-width: 100%;
    padding: 1.25rem 1.25rem 4rem;
  }
}

@media (max-width: 1024px) {
  .hero-banner {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .diagnostic-studio {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .pricing-grid {
    grid-template-columns: 1fr;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
  }
}

@media (max-width: 768px) {
  .app-container {
    padding-left: max(0.85rem, env(safe-area-inset-left));
    padding-right: max(0.85rem, env(safe-area-inset-right));
    padding-top: max(0.85rem, env(safe-area-inset-top));
    padding-bottom: 6rem; /* Space for mobile bottom dock */
  }
  .hero-banner {
    padding: 1.5rem 1.25rem;
  }
  .hero-content h2 {
    font-size: 1.7rem;
    line-height: 1.25;
  }
  .hero-desc {
    font-size: 0.9rem;
    margin-bottom: 1.25rem;
  }
  .hero-stats {
    gap: 1.25rem;
  }
  .hero-image-wrap {
    max-height: 240px;
  }
  .card-panel, .result-card, .garages-box {
    padding: 1.25rem;
    border-radius: var(--radius-md);
  }
}

@media (max-width: 640px) {
  .top-nav {
    flex-direction: column;
    gap: 0.85rem;
    align-items: stretch;
    padding: 0.85rem 1rem;
    border-radius: var(--radius-md);
  }
  .brand {
    justify-content: flex-start;
  }
  .nav-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    width: 100%;
  }
  .btn-torch, .btn-nav-action {
    width: 100%;
    justify-content: center;
    padding: 0.55rem 0.5rem;
    font-size: 0.8rem;
    text-align: center;
  }
  .breakdown-row {
    flex-direction: column;
    gap: 0.25rem;
  }
  .breakdown-label {
    min-width: unset;
    font-size: 0.82rem;
    color: var(--accent-cyan);
  }
  .breakdown-val {
    font-size: 0.88rem;
    line-height: 1.5;
  }
  .soundboard-grid {
    grid-template-columns: 1fr;
  }
  .telemetry-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.6rem;
  }
  .capture-controls {
    grid-template-columns: 1fr;
  }
  .btn-record {
    grid-column: span 1;
    padding: 0.95rem 1rem;
    font-size: 0.98rem;
  }
  .modal-overlay {
    padding: 0.6rem;
  }
  .modal-content-card {
    padding: 1.35rem 1rem;
    max-height: 94vh;
    border-radius: var(--radius-md);
  }
  .cert-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
  }
  .cert-header h3 {
    font-size: 1.25rem;
  }
  .cert-header p {
    font-size: 0.75rem;
  }
  .cert-stamp {
    font-size: 0.95rem;
    padding: 0.5rem 1rem;
  }
  .cert-footer-actions {
    flex-direction: column;
    gap: 0.6rem;
  }
}

@media (max-width: 520px) {
  .result-card {
    padding: 1.15rem 0.9rem;
  }
  .result-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.65rem;
  }
  .result-fault-title {
    font-size: 1.22rem;
    line-height: 1.3;
  }
  .confidence-gauge-box {
    align-items: flex-start;
    flex-direction: row;
    align-items: baseline;
    gap: 0.4rem;
  }
  .confidence-val {
    font-size: 1.45rem;
  }
  .garage-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.85rem;
  }
  .garage-item .garage-meta {
    flex-wrap: wrap;
    gap: 0.45rem 0.85rem;
  }
  .garage-item > div:last-child {
    width: 100%;
    display: flex;
    gap: 0.5rem;
  }
  .garage-item > div:last-child a,
  .garage-item > div:last-child button {
    flex: 1;
    text-align: center;
    justify-content: center;
  }
  .history-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.85rem;
  }
  .history-actions {
    width: 100%;
    justify-content: flex-end;
  }
  .parts-table th, .parts-table td {
    padding: 0.45rem 0.35rem;
    font-size: 0.78rem;
  }
  .affiliate-buy-btn {
    font-size: 0.82rem;
    padding: 0.75rem 0.65rem;
    text-align: center;
    line-height: 1.35;
  }
  .mechanic-script-box {
    padding: 0.9rem;
  }
  .script-content {
    font-size: 0.82rem;
  }
}

@media (max-width: 380px) {
  .app-container {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }
  .brand-text h1 {
    font-size: 1.1rem;
  }
  .brand-icon {
    width: 38px;
    height: 38px;
    font-size: 1.1rem;
  }
  .scanner-btn-wrapper {
    width: 145px;
    height: 145px;
  }
  .btn-master-scan {
    width: 120px;
    height: 120px;
  }
  .btn-master-scan i {
    font-size: 1.8rem;
  }
  .metric-val {
    font-size: 0.98rem;
  }
  .hero-content h2 {
    font-size: 1.4rem;
  }
}

/* Scan Countdown Overlay */
.scan-countdown-overlay {
  position: absolute;
  inset: 0;
  background: rgba(5, 7, 10, 0.88);
  backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  z-index: 10;
  padding: 1.5rem;
  text-align: center;
}

.countdown-circle {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--accent-cyan);
  text-shadow: 0 0 20px rgba(0, 242, 254, 0.6);
}

.scan-countdown-overlay p {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.countdown-progress-bar {
  width: 180px;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-top: 0.25rem;
}

.countdown-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-purple));
  border-radius: var(--radius-full);
  transition: width 0.1s linear;
}

/* Standby Result Placeholder */
.result-standby-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px dashed rgba(0, 242, 254, 0.25);
  border-radius: var(--radius-lg);
  padding: 3rem 2rem;
  text-align: center;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.standby-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(0, 242, 254, 0.1);
  border: 1px solid rgba(0, 242, 254, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  color: var(--accent-cyan);
  box-shadow: 0 0 20px rgba(0, 242, 254, 0.2);
}

.result-standby-card h3 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  color: #fff;
}

.result-standby-card p {
  color: var(--text-muted);
  font-size: 0.92rem;
  max-width: 480px;
  line-height: 1.6;
}

.veh-pill-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-family: var(--font-mono);
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  background: rgba(0, 242, 254, 0.12);
  border: 1px solid rgba(0, 242, 254, 0.3);
  border-radius: var(--radius-full);
  color: var(--accent-cyan);
  margin-bottom: 0.4rem;
}

.btn-refresh-loc {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 0.75rem;
  padding: 0.3rem 0.65rem;
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: var(--transition);
}

.btn-refresh-loc:hover {
  background: rgba(0, 242, 254, 0.2);
  color: var(--accent-cyan);
  border-color: var(--accent-cyan);
}

/* History Modal */
.history-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  max-height: 480px;
  overflow-y: auto;
}

.history-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: var(--transition);
}

.history-item:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(0, 242, 254, 0.3);
}

.history-item-meta {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.history-item-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: #fff;
}

.history-item-sub {
  font-size: 0.78rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

.history-actions {
  display: flex;
  gap: 0.5rem;
}

.btn-history-view {
  background: rgba(0, 242, 254, 0.15);
  border: 1px solid rgba(0, 242, 254, 0.3);
  color: var(--accent-cyan);
  padding: 0.35rem 0.75rem;
  border-radius: 4px;
  font-size: 0.78rem;
  cursor: pointer;
}

.btn-history-view:hover {
  background: var(--accent-cyan);
  color: #000;
}

.btn-history-del {
  background: rgba(255, 42, 95, 0.1);
  border: 1px solid rgba(255, 42, 95, 0.25);
  color: #ff688c;
  padding: 0.35rem 0.5rem;
  border-radius: 4px;
  font-size: 0.78rem;
  cursor: pointer;
}

.btn-history-del:hover {
  background: var(--accent-danger);
  color: #fff;
}

.cert-spectrogram-embed {
  margin: 1.25rem 0;
  background: rgba(0, 0, 0, 0.5);
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(0, 242, 254, 0.2);
}

/* Mobile-First Device Cockpit Elements */
.mobile-quick-bar {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.btn-torch {
  background: rgba(255, 170, 0, 0.12);
  border: 1px solid rgba(255, 170, 0, 0.35);
  color: var(--accent-amber);
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
  transition: var(--transition);
}

.btn-torch.active {
  background: var(--accent-amber);
  color: #000;
  box-shadow: 0 0 20px rgba(255, 170, 0, 0.6);
}

.btn-pwa-install {
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
  border: none;
  color: #000;
  padding: 0.5rem 0.95rem;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  transition: var(--transition);
}

.btn-pwa-install:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 20px rgba(0, 242, 254, 0.4);
}

/* Master Circular Scanner Pulse Hero (Mobile-First) */
.mobile-scan-hub {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 1.5rem 0 2rem;
  text-align: center;
  position: relative;
}

.scanner-btn-wrapper {
  position: relative;
  width: 170px;
  height: 170px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

.scanner-ring {
  position: absolute;
  inset: -12px;
  border-radius: 50%;
  border: 2px dashed rgba(0, 242, 254, 0.35);
  animation: rotateRing 18s linear infinite;
  pointer-events: none;
}

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

.scanner-ring-pulse {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 1.5px solid rgba(0, 242, 254, 0.2);
  animation: ringPulse 2.4s ease-out infinite;
  pointer-events: none;
}

@keyframes ringPulse {
  0% { transform: scale(0.95); opacity: 0.8; }
  100% { transform: scale(1.3); opacity: 0; }
}

.btn-master-scan {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #1a2a40, #0a111a);
  border: 3px solid var(--accent-cyan);
  box-shadow: 0 0 35px rgba(0, 242, 254, 0.35), inset 0 0 20px rgba(0, 242, 254, 0.25);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  color: #fff;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
  z-index: 2;
  user-select: none;
  -webkit-user-select: none;
}

.btn-master-scan i {
  font-size: 2.2rem;
  color: var(--accent-cyan);
  transition: var(--transition);
}

.btn-master-scan span {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.btn-master-scan:active, .btn-master-scan.scanning {
  transform: scale(0.94);
  border-color: var(--accent-danger);
  box-shadow: 0 0 45px rgba(255, 42, 95, 0.5), inset 0 0 25px rgba(255, 42, 95, 0.3);
}

.btn-master-scan.scanning i {
  color: var(--accent-danger);
  animation: pulse 1s infinite;
}

/* Mobile Bottom Navigation Dock */
.mobile-bottom-dock {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(9, 13, 20, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-subtle);
  padding: 0.6rem 0.5rem calc(0.6rem + env(safe-area-inset-bottom));
  z-index: 999;
  justify-content: space-around;
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.7);
}

.dock-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.65rem;
  font-weight: 600;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  padding: 0.2rem 0.5rem;
}

.dock-item i {
  font-size: 1.15rem;
}

.dock-item.active, .dock-item:hover {
  color: var(--accent-cyan);
}

@media (max-width: 768px) {
  .mobile-bottom-dock {
    display: flex;
  }
  .app-container {
    padding-bottom: 6rem;
  }
}

/* SEO Automotive Knowledge & FAQ Accordion Section */
.seo-knowledge-section {
  margin-top: 3.5rem;
  padding-top: 2.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.section-headline {
  text-align: center;
  margin-bottom: 2rem;
}

.section-headline h2 {
  font-family: var(--font-display);
  font-size: 1.85rem;
  color: #fff;
  margin-bottom: 0.5rem;
}

.section-headline p {
  color: var(--text-muted);
  font-size: 0.95rem;
  max-width: 650px;
  margin: 0 auto;
}

.knowledge-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-bottom: 2.5rem;
}

.knowledge-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.35rem;
  transition: var(--transition);
}

.knowledge-card:hover {
  border-color: rgba(0, 242, 254, 0.3);
  transform: translateY(-2px);
}

.knowledge-card h3 {
  font-size: 1.05rem;
  color: #fff;
  margin-bottom: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.knowledge-card h3 i {
  color: var(--accent-cyan);
  font-size: 0.9rem;
}

.knowledge-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

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

/* FAQ Accordion */
.faq-accordion {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: var(--transition);
}

.faq-item.active {
  border-color: rgba(0, 242, 254, 0.4);
}

.faq-question {
  width: 100%;
  padding: 1.15rem 1.4rem;
  background: transparent;
  border: none;
  color: #fff;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  text-align: left;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}

.faq-question i {
  color: var(--accent-cyan);
  transition: transform 0.3s ease;
}

.faq-item.active .faq-question i {
  transform: rotate(180deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease, padding 0.35s ease;
  padding: 0 1.4rem;
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.6;
}

.faq-item.active .faq-answer {
  max-height: 300px;
  padding: 0 1.4rem 1.25rem;
}

/* Print Styles for Certificate */
@media print {
  body * {
    visibility: hidden;
  }
  .modal-overlay.active, .cert-card, .cert-card * {
    visibility: visible;
  }
  .cert-card {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    max-width: 100%;
    background: #fff !important;
    color: #000 !important;
    border: 2px solid #000 !important;
    box-shadow: none !important;
  }
  .cert-header h3, .cert-header p, .cert-field span, .cert-field label {
    color: #000 !important;
  }
  .modal-close-btn, .cert-footer-actions {
    display: none !important;
  }
}
