/* ============================================
   RadarAlert Pro PWA - Styles
   ============================================ */
:root {
  --bg-primary: #0a0a1e;
  --bg-secondary: #1a1a2e;
  --bg-card: #1e1e3a;
  --bg-input: #252545;
  --accent-green: #4CAF50;
  --accent-yellow: #FFD600;
  --accent-red: #FF5252;
  --accent-orange: #FF9800;
  --accent-blue: #2196F3;
  --text-primary: #ffffff;
  --text-secondary: #cccccc;
  --text-muted: #888888;
  --border-color: #333355;
  --shadow: 0 2px 12px rgba(0,0,0,0.4);
  --radius: 12px;
  --radius-sm: 8px;
  --tab-height: 60px;
  --header-height: 56px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
.leaflet-pane,
.leaflet-tile,
.leaflet-marker-icon,
.leaflet-marker-shadow,
.leaflet-tile-container,
.leaflet-map-pane,
.leaflet-tile-pane,
.leaflet-overlay-pane,
.leaflet-shadow-pane,
.leaflet-marker-pane,
.leaflet-tooltip-pane,
.leaflet-popup-pane {
  box-sizing: content-box;
}
html, body { height: 100%; overflow: hidden; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ── App Shell ─────────────────────────── */
#app {
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* ── Header ────────────────────────────── */
.app-header {
  min-height: var(--header-height);
  padding-top: var(--safe-top);
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-left: 16px;
  padding-right: 16px;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
  position: relative;
  z-index: 100;
}
.app-header .logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.1em;
  color: var(--accent-yellow);
}
.app-header .logo img { width: 32px; height: 32px; border-radius: 8px; }
.app-header .header-actions { display: flex; gap: 8px; align-items: center; }
.header-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.3em;
  cursor: pointer;
  padding: 6px;
  border-radius: 50%;
  transition: background 0.2s;
}
.header-btn:hover { background: rgba(255,255,255,0.1); }
.header-btn.active { color: var(--accent-green); }

/* ── Screens Container ─────────────────── */
.screens-container {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  position: relative;
  z-index: 1;
  isolation: isolate;
}
.screen {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
  display: none;
  -webkit-overflow-scrolling: touch;
}
.screen.active { display: flex; flex-direction: column; }
#screen-map.active { overflow: hidden; }

/* ── Bottom Tabs ───────────────────────── */
.bottom-tabs {
  height: var(--tab-height);
  padding-bottom: var(--safe-bottom);
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: space-around;
  border-top: 1px solid var(--border-color);
  flex-shrink: 0;
  position: relative;
  z-index: 100;
}
.tab-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.7em;
  cursor: pointer;
  padding: 6px 0;
  transition: color 0.2s;
}
.tab-btn svg { width: 24px; height: 24px; }
.tab-btn.active { color: var(--accent-green); }
.tab-btn.active svg { filter: drop-shadow(0 0 4px rgba(76,175,80,0.5)); }

/* ── Map Screen ────────────────────────── */
#screen-map {
  height: 100%;
  max-height: 100%;
  overflow: hidden;
}
#map-container {
  flex: 1 1 0%;
  min-height: 0;
  max-height: 100%;
  position: relative;
  overflow: hidden;
  background: #0d1117;
}
#map-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.map-overlay {
  position: absolute;
  bottom: 16px;
  left: 16px;
  right: 16px;
  display: flex;
  gap: 8px;
  z-index: 1000;
  pointer-events: none;
}
.map-overlay > * { pointer-events: auto; }
.map-fab {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4em;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.2s;
}
.map-fab:active { transform: scale(0.9); }
.fab-locate { background: var(--accent-blue); color: #fff; }
.fab-report { background: var(--accent-red); color: #fff; margin-left: auto; }
/* ── Search Bar ────────────────────────── */
.map-search-bar {
  position: absolute;
  top: 8px;
  left: 8px;
  right: 8px;
  z-index: 1001;
}
.search-input-wrap {
  display: flex;
  align-items: center;
  background: rgba(10,10,30,0.92);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  padding: 0 14px;
  gap: 8px;
}
.search-icon { flex-shrink: 0; color: var(--text-muted); }
.search-input-wrap input {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 0.9em;
  padding: 10px 0;
  outline: none;
}
.search-input-wrap input::placeholder { color: var(--text-muted); }
.search-clear {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.3em;
  cursor: pointer;
  padding: 0 2px;
}
.search-results {
  background: rgba(10,10,30,0.96);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  margin-top: 4px;
  max-height: 260px;
  overflow-y: auto;
  padding: 4px;
}
.search-result-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  background: none;
  border: none;
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 0.85em;
  text-align: left;
  cursor: pointer;
  line-height: 1.3;
}
.search-result-item:active { background: rgba(255,255,255,0.08); }
.search-result-item span { overflow: hidden; text-overflow: ellipsis; }
.search-loading { padding: 14px; text-align: center; color: var(--text-muted); font-size: 0.85em; }
.search-section-title { padding: 8px 12px 4px; font-size: 0.7em; text-transform: uppercase; color: var(--text-muted); font-weight: 600; }

/* ── Favorites Bar ────────────────────── */
.favorites-bar {
  position: absolute;
  top: 52px;
  left: 8px;
  z-index: 1001;
  display: flex;
  gap: 6px;
}
.fav-quick-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background: rgba(10,10,30,0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1em;
  cursor: pointer;
}
.fav-quick-btn:active { transform: scale(0.9); }
.fav-del {
  background: none;
  border: none;
  color: var(--accent-red);
  font-size: 1.2em;
  cursor: pointer;
  padding: 0 4px;
}

/* ── Road Speed Limit Sign ─────────── */
.road-speed-limit {
  position: absolute;
  top: 108px;
  left: 96px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid #FF5252;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  font-weight: 900;
  font-size: 0.95em;
  color: #000;
}

/* ── Navigation Panel ─────────────── */
/* ── Navigation panel: TOP instruction (Waze-style) ── */
.nav-panel {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1002;
  padding: 0;
  flex-shrink: 0;
  pointer-events: none;
}
.nav-instruction {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  min-height: 80px;
  background: rgba(26,26,46,0.95);
  color: #fff;
  pointer-events: auto;
}
.nav-maneuver {
  width: 60px;
  height: 60px;
  background: #7C3AED;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.nav-maneuver svg { width: 36px; height: 36px; }
.nav-text {
  flex: 1;
  font-size: 0.85em;
  font-weight: 500;
  line-height: 1.3;
  color: rgba(255,255,255,0.85);
}
.nav-distance {
  font-size: 1.5em;
  font-weight: 800;
  color: #fff;
  line-height: 1.1;
}
/* ── Navigation panel: BOTTOM summary (Waze-style) ── */
.nav-summary {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: rgba(26,26,46,0.95);
  border-radius: 18px 18px 0 0;
  font-size: 0.9em;
  color: #fff;
  z-index: 1002;
  pointer-events: auto;
}
.nav-summary span { flex: 1; font-weight: 600; }
.nav-stop-btn {
  background: #EF4444;
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 10px 24px;
  font-size: 0.9em;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.5px;
}
/* ── Current street name overlay during navigation ── */
.nav-street-overlay {
  position: absolute;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(26,26,46,0.85);
  color: #fff;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.8em;
  font-weight: 600;
  white-space: nowrap;
  z-index: 1001;
  pointer-events: none;
  max-width: 80%;
  overflow: hidden;
  text-overflow: ellipsis;
  display: none;
}

.speed-indicator {
  position: absolute;
  top: 96px;
  left: 16px;
  background: rgba(10,10,30,0.9);
  border: 2px solid var(--accent-green);
  border-radius: 50%;
  width: 72px;
  height: 72px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.speed-value { font-size: 1.6em; font-weight: 700; color: var(--accent-green); line-height: 1; }
.speed-unit { font-size: 0.6em; color: var(--text-muted); }
.radar-count-badge {
  position: absolute;
  top: 52px;
  right: 16px;
  background: rgba(10,10,30,0.9);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-size: 0.8em;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 6px;
}
.radar-count-badge .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent-red); }
.map-filter-bar {
  position: absolute;
  top: 176px;
  left: 8px;
  right: 8px;
  z-index: 1000;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 4px 0;
  -webkit-overflow-scrolling: touch;
}
.map-filter-bar::-webkit-scrollbar { display: none; }
.poi-map-icon { background: none !important; border: none !important; }

/* ── Fuel Station Markers ─────────── */
.fuel-marker-wrap { background: none !important; border: none !important; }
.fuel-marker {
  background: rgba(10,10,30,0.88);
  color: #fff;
  font-size: 0.7em;
  font-weight: 700;
  padding: 3px 6px;
  border-radius: 10px;
  border: 1px solid #666;
  white-space: nowrap;
  text-align: center;
  line-height: 1.2;
}
.fuel-marker.cheap {
  background: #4CAF50;
  border-color: #4CAF50;
  color: #fff;
}
.fuel-popup { padding: 4px; }
.fuel-prices { display: flex; flex-direction: column; gap: 3px; }
.fuel-price-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85em;
}
.fuel-price-row span { color: #aaa; }
.fuel-price-row strong { color: var(--accent-green); }

/* ── Cheap Fuel Panel ─────────────── */
.cheap-fuel-panel {
  position: absolute;
  bottom: 72px;
  left: 8px;
  right: 8px;
  z-index: 1001;
  background: rgba(10,10,30,0.95);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 10px;
  max-height: 220px;
  overflow-y: auto;
}
.cfp-title {
  font-size: 0.75em;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--accent-yellow);
  margin-bottom: 8px;
  padding: 0 4px;
}
.cfp-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 4px;
  background: none;
  border: none;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
  cursor: pointer;
  text-align: left;
  font-size: 0.85em;
}
.cfp-row:last-of-type { border-bottom: none; }
.cfp-row:active { background: rgba(255,255,255,0.05); }
.cfp-rank {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent-green);
  color: #fff;
  font-weight: 700;
  font-size: 0.75em;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.cfp-info { flex: 1; line-height: 1.3; }
.cfp-price {
  font-weight: 700;
  color: var(--accent-green);
  font-size: 0.95em;
  flex-shrink: 0;
}
.cfp-close {
  position: absolute;
  top: 6px;
  right: 8px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.2em;
  cursor: pointer;
}
.filter-chip {
  flex-shrink: 0;
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--border-color);
  background: rgba(10,10,30,0.85);
  color: var(--text-secondary);
  font-size: 0.75em;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}
.filter-chip.active {
  background: var(--accent-green);
  color: #fff;
  border-color: var(--accent-green);
}

/* ── Alert Banner ──────────────────────── */
.alert-banner {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  padding: 12px 16px;
  display: none;
  align-items: center;
  gap: 12px;
  animation: slideDown 0.3s ease;
}
.alert-banner.show { display: flex; }
.alert-banner.warning { background: linear-gradient(135deg, #FF9800, #F57C00); }
.alert-banner.close { background: linear-gradient(135deg, #FF6D00, #E65100); }
.alert-banner.danger { background: linear-gradient(135deg, #FF5252, #D32F2F); animation: pulseDanger 0.6s ease infinite alternate; }
.alert-banner.info { background: linear-gradient(135deg, #2196F3, #1976D2); }
@keyframes pulseDanger {
  from { opacity: 1; }
  to { opacity: 0.85; }
}
.alert-banner .alert-icon { font-size: 1.8em; }
.alert-banner .alert-text { flex: 1; }
.alert-banner .alert-title { font-weight: 700; font-size: 0.95em; }
.alert-banner .alert-detail { font-size: 0.8em; opacity: 0.9; }
.alert-speed-limit {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #fff;
  color: #000;
  font-weight: 900;
  font-size: 0.85em;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid #FF5252;
  flex-shrink: 0;
}
.alert-banner .alert-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.4em;
  cursor: pointer;
  padding: 4px;
}
@keyframes slideDown {
  from { transform: translateY(-100%); }
  to { transform: translateY(0); }
}

/* ── Reports Screen ────────────────────── */
.screen-header {
  padding: 16px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
}
.screen-title { font-size: 1.2em; font-weight: 700; }
.screen-subtitle { font-size: 0.8em; color: var(--text-muted); margin-top: 2px; }
.report-categories {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 16px;
}
.report-cat-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 0.75em;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}
.report-cat-btn:active { transform: scale(0.95); }
.report-cat-btn .cat-icon { font-size: 2em; }
.report-cat-btn.selected { border-color: var(--accent-green); background: rgba(76,175,80,0.15); }

.reports-list {
  flex: 1;
  overflow-y: auto;
  padding: 0 16px 16px;
}
.report-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 10px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.report-card .report-icon { font-size: 1.8em; flex-shrink: 0; }
.report-card .report-info { flex: 1; min-width: 0; }
.report-card .report-type { font-weight: 600; font-size: 0.9em; }
.report-card .report-meta { font-size: 0.75em; color: var(--text-muted); margin-top: 2px; }
.report-card .report-actions { display: flex; gap: 8px; margin-top: 8px; }
.report-action-btn {
  padding: 4px 12px;
  border-radius: 16px;
  border: 1px solid var(--border-color);
  background: var(--bg-input);
  color: var(--text-secondary);
  font-size: 0.75em;
  cursor: pointer;
}
.report-action-btn.confirm { border-color: var(--accent-green); color: var(--accent-green); }
.report-action-btn.deny { border-color: var(--accent-red); color: var(--accent-red); }

/* ── POIs Screen ───────────────────────── */
.poi-tabs {
  display: flex;
  overflow-x: auto;
  gap: 4px;
  padding: 12px 16px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  -webkit-overflow-scrolling: touch;
}
.poi-tabs::-webkit-scrollbar { display: none; }
.poi-tab {
  flex-shrink: 0;
  padding: 8px 16px;
  border-radius: 20px;
  border: 1px solid var(--border-color);
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.8em;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}
.poi-tab.active {
  background: var(--accent-green);
  color: #fff;
  border-color: var(--accent-green);
}
.poi-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
}
.poi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 10px;
  display: flex;
  gap: 12px;
  align-items: center;
  cursor: pointer;
  transition: border-color 0.2s;
}
.poi-card:active { border-color: var(--accent-green); }
.poi-card .poi-icon { font-size: 2em; flex-shrink: 0; }
.poi-card .poi-info { flex: 1; min-width: 0; }
.poi-card .poi-name { font-weight: 600; font-size: 0.9em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.poi-card .poi-address { font-size: 0.75em; color: var(--text-muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.poi-card .poi-distance { font-size: 0.75em; color: var(--accent-green); font-weight: 600; }
.poi-card .poi-rating { display: flex; align-items: center; gap: 4px; font-size: 0.75em; color: var(--accent-yellow); margin-top: 4px; }
.poi-card .poi-price { font-size: 0.85em; color: var(--accent-green); font-weight: 700; flex-shrink: 0; }
.poi-card .poi-nav-btn {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--accent-blue); color: #fff; border: none;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0; font-size: 1em;
}

/* ── Profile Screen ────────────────────── */
.profile-header {
  text-align: center;
  padding: 30px 20px;
  background: linear-gradient(135deg, var(--bg-secondary), #0a2a1e);
}
.profile-avatar {
  width: 80px; height: 80px; border-radius: 50%;
  background: var(--accent-green); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 2em; font-weight: 700;
  margin: 0 auto 12px;
  border: 3px solid var(--accent-yellow);
}
.profile-name { font-size: 1.2em; font-weight: 700; }
.profile-email { font-size: 0.85em; color: var(--text-muted); margin-top: 2px; }
.profile-badge {
  display: inline-block;
  padding: 4px 16px;
  border-radius: 16px;
  font-size: 0.8em;
  font-weight: 600;
  margin-top: 10px;
}
.profile-badge.free { background: var(--bg-input); color: var(--text-muted); }
.profile-badge.plus { background: var(--accent-yellow); color: #1a1a2e; }

.profile-section {
  padding: 16px;
}
.profile-section-title {
  font-size: 0.75em;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 10px;
}
.profile-menu-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  margin-bottom: 8px;
  cursor: pointer;
  transition: border-color 0.2s;
}
.profile-menu-item:active { border-color: var(--accent-green); }
.profile-menu-item .menu-icon { font-size: 1.4em; }
.profile-menu-item .menu-text { flex: 1; }
.profile-menu-item .menu-label { font-size: 0.9em; font-weight: 500; }
.profile-menu-item .menu-desc { font-size: 0.75em; color: var(--text-muted); }
.profile-menu-item .menu-arrow { color: var(--text-muted); font-size: 0.9em; }

/* ── Auth Screen ───────────────────────── */
.auth-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px 24px;
  min-height: 100%;
}
.auth-logo { margin-bottom: 30px; text-align: center; }
.auth-logo img { width: 80px; height: 80px; border-radius: 16px; }
.auth-logo h2 { color: var(--accent-yellow); margin-top: 12px; font-size: 1.4em; }
.auth-form { width: 100%; max-width: 360px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 0.8em; color: var(--text-muted); margin-bottom: 6px; }
.form-input {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 1em;
  outline: none;
  transition: border-color 0.2s;
}
.form-input:focus { border-color: var(--accent-green); }
.form-input::placeholder { color: var(--text-muted); }
.btn {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1em;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--accent-green); color: #fff; }
.btn-gold { background: var(--accent-yellow); color: #1a1a2e; }
.btn-outline { background: transparent; border: 1px solid var(--border-color); color: var(--text-secondary); }
.btn-danger { background: var(--accent-red); color: #fff; }
.auth-switch { margin-top: 20px; text-align: center; font-size: 0.85em; color: var(--text-muted); }
.auth-switch a { color: var(--accent-green); cursor: pointer; text-decoration: none; }
.auth-error { background: rgba(255,82,82,0.15); border: 1px solid var(--accent-red); color: var(--accent-red); padding: 10px 14px; border-radius: var(--radius-sm); font-size: 0.85em; margin-bottom: 16px; display: none; }
.auth-error.show { display: block; }
.form-helper { display: block; font-size: 0.75em; color: var(--text-muted); margin-top: 6px; line-height: 1.4; }
.auth-promo-result { padding: 10px 14px; border-radius: var(--radius-sm); font-size: 0.85em; margin-bottom: 16px; display: none; line-height: 1.4; }
.auth-promo-result.show { display: block; }
.auth-promo-result.success { background: rgba(0,200,83,0.15); border: 1px solid var(--accent-green); color: var(--accent-green); }
.auth-promo-result.warning { background: rgba(255,193,7,0.15); border: 1px solid #ffc107; color: #ffc107; }

/* ── Modal ─────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: none;
  align-items: flex-end;
  justify-content: center;
  z-index: 200;
  animation: fadeIn 0.2s;
}
.modal-overlay.show { display: flex; }
.modal-content {
  background: var(--bg-secondary);
  border-radius: 20px 20px 0 0;
  width: 100%;
  max-width: 500px;
  max-height: 85vh;
  overflow-y: auto;
  animation: slideUp 0.3s ease;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
}
.modal-header h3 { font-size: 1.1em; font-weight: 700; }
.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5em;
  cursor: pointer;
  padding: 4px;
}
.modal-body { padding: 20px; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

/* ── Subscription Card ─────────────────── */
.sub-card {
  background: linear-gradient(135deg, #1a1a2e, #0a2a1e);
  border: 2px solid var(--accent-yellow);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  text-align: center;
}
.sub-card .sub-price { font-size: 2em; font-weight: 700; color: var(--accent-yellow); }
.sub-card .sub-period { font-size: 0.85em; color: var(--text-muted); }
.sub-card .sub-features { list-style: none; text-align: left; margin: 16px 0; }
.sub-card .sub-features li { padding: 5px 0; font-size: 0.85em; color: var(--text-secondary); }
.sub-card .sub-features li::before { content: '\2705 '; }

/* ── Promo Code ────────────────────────── */
.promo-input-group {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.promo-input-group .form-input { flex: 1; }
.promo-input-group .btn { width: auto; padding: 12px 20px; }

/* ── Loading & Empty States ────────────── */
.loading-spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  color: var(--text-muted);
  gap: 10px;
}
.spinner {
  width: 24px; height: 24px;
  border: 3px solid var(--border-color);
  border-top-color: var(--accent-green);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}
.empty-state .empty-icon { font-size: 3em; margin-bottom: 12px; }
.empty-state .empty-text { font-size: 0.9em; }

/* ── Toast Notifications ───────────────── */
.toast-container {
  position: fixed;
  top: calc(var(--header-height) + var(--safe-top) + 8px);
  left: 16px;
  right: 16px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 0.85em;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideDown 0.3s ease;
  pointer-events: auto;
  box-shadow: var(--shadow);
}
.toast.success { border-color: var(--accent-green); }
.toast.error { border-color: var(--accent-red); }
.toast.warning { border-color: var(--accent-orange); }

/* ── Install Banner ────────────────────── */
.install-banner {
  position: fixed;
  bottom: calc(var(--tab-height) + var(--safe-bottom) + 8px);
  left: 16px;
  right: 16px;
  background: linear-gradient(135deg, var(--bg-secondary), #0a2a1e);
  border: 1px solid var(--accent-green);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: none;
  align-items: center;
  gap: 12px;
  z-index: 150;
  box-shadow: var(--shadow);
}
.install-banner.show { display: flex; }
.install-banner img { width: 40px; height: 40px; border-radius: 8px; }
.install-banner .install-text { flex: 1; }
.install-banner .install-title { font-weight: 600; font-size: 0.9em; }
.install-banner .install-desc { font-size: 0.75em; color: var(--text-muted); }
.install-banner .btn { width: auto; padding: 8px 18px; font-size: 0.85em; }
.install-banner .install-dismiss {
  background: none; border: none; color: var(--text-muted);
  font-size: 1.2em; cursor: pointer; padding: 4px;
}

/* ── Offline Indicator ─────────────────── */
.offline-bar {
  background: var(--accent-orange);
  color: #fff;
  text-align: center;
  padding: 4px;
  font-size: 0.75em;
  font-weight: 600;
  display: none;
}
.offline-bar.show { display: block; }

/* ── Scrollbar ─────────────────────────── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 4px; }

/* ── Responsive ────────────────────────── */
@media (min-width: 768px) {
  .screens-container { max-width: 500px; margin: 0 auto; width: 100%; }
  .bottom-tabs { max-width: 500px; margin: 0 auto; }
}

/* ── Map info window ───────────────────── */
.radar-info {
  background: var(--bg-secondary);
  color: var(--text-primary);
  padding: 10px;
  border-radius: var(--radius-sm);
  min-width: 180px;
}
.radar-info .radar-type { font-weight: 700; font-size: 0.9em; color: var(--accent-yellow); }
.radar-info .radar-speed { font-size: 0.85em; margin-top: 4px; }
.radar-info .radar-road { font-size: 0.8em; color: var(--text-muted); margin-top: 2px; }
.radar-info .radar-confirm { font-size: 0.75em; color: var(--accent-green); margin-top: 4px; }

/* ── Now Playing Bar ──────────────────── */
.now-playing-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: rgba(76,175,80,0.12);
  border-bottom: 1px solid var(--accent-green);
  flex-shrink: 0;
  z-index: 100;
}
.np-icon { font-size: 1em; }
.np-name { font-weight: 600; font-size: 0.8em; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-genre { font-size: 0.7em; color: var(--accent-green); }
.np-stop { background: none; border: none; color: var(--accent-red); font-size: 1.1em; cursor: pointer; padding: 4px; }

/* ── Radio Genre Pills ────────────────── */
.radio-genres {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 4px 0 12px;
  -webkit-overflow-scrolling: touch;
}
.radio-genres::-webkit-scrollbar { display: none; }
.genre-pill {
  flex-shrink: 0;
  padding: 5px 12px;
  border-radius: 16px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 0.75em;
  cursor: pointer;
  transition: all 0.2s;
}
.genre-pill.active {
  background: var(--accent-green);
  color: #fff;
  border-color: var(--accent-green);
}
.radio-now-playing {
  background: var(--bg-card);
  border: 1px solid var(--accent-green);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

/* ── iOS Install Guide ────────────────── */
.ios-install-guide { padding: 8px 0; }
.ios-install-step {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-color);
}
.ios-install-step:last-of-type { border-bottom: none; }
.ios-step-number {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-blue);
  color: #fff;
  font-weight: 700;
  font-size: 0.9em;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.ios-step-icon {
  flex-shrink: 0;
  width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ios-step-text {
  flex: 1;
  font-size: 0.9em;
  line-height: 1.4;
}

/* ── Settings Rows & Toggles ─────────── */
.setting-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  margin-bottom: 6px;
}
.setting-row.setting-row-slider { flex-wrap: wrap; }
.setting-icon { font-size: 1.3em; flex-shrink: 0; width: 28px; text-align: center; }
.setting-text { flex: 1; min-width: 0; }
.setting-label { font-size: 0.88em; font-weight: 500; }
.setting-desc { font-size: 0.73em; color: var(--text-muted); margin-top: 1px; }
.setting-input {
  width: 100%;
  margin-top: 6px;
  padding: 8px 10px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.88em;
  outline: none;
}
.setting-input:focus { border-color: var(--accent-green); }
.setting-select {
  width: 100%;
  margin-top: 6px;
  padding: 8px 10px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.85em;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23888' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
}
.setting-select:focus { border-color: var(--accent-green); }
.setting-range {
  width: 100%;
  margin-top: 8px;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  background: var(--border-color);
  border-radius: 3px;
  outline: none;
}
.setting-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent-green);
  border: 2px solid #fff;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,0.4);
}
.setting-range::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent-green);
  border: 2px solid #fff;
  cursor: pointer;
}

/* Toggle switch */
.toggle {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 26px;
  flex-shrink: 0;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 26px;
  transition: background 0.25s, border-color 0.25s;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  left: 2px;
  bottom: 2px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.25s;
}
.toggle input:checked + .toggle-slider {
  background: var(--accent-green);
  border-color: var(--accent-green);
}
.toggle input:checked + .toggle-slider::before {
  transform: translateX(20px);
}
