/* ============================================================
   Road Warrior EV — Cookie Consent + Lead Capture Styles
   ============================================================ */

/* ============================================================
   COOKIE CONSENT BANNER
   ============================================================ */
#cookieConsentBanner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10000;
  background: rgba(10, 15, 30, 0.97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(108, 71, 255, 0.3);
  padding: 0;
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.4);
}

#cookieConsentBanner.show {
  transform: translateY(0);
}

.cookie-banner-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.cookie-icon {
  font-size: 28px;
  flex-shrink: 0;
}

.cookie-text {
  flex: 1;
  min-width: 240px;
}

.cookie-text h4 {
  color: #f1f5f9;
  font-size: 14px;
  font-weight: 700;
  margin: 0 0 4px;
}

.cookie-text p {
  color: #94a3b8;
  font-size: 12px;
  margin: 0;
  line-height: 1.5;
}

.cookie-text a {
  color: #6c47ff;
  text-decoration: none;
}

.cookie-text a:hover {
  text-decoration: underline;
}

.cookie-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  flex-shrink: 0;
}

.cookie-btn-accept {
  background: linear-gradient(135deg, #6c47ff, #00d4ff);
  color: #fff;
  border: none;
  padding: 9px 20px;
  border-radius: 50px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.2s;
  white-space: nowrap;
}

.cookie-btn-accept:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.cookie-btn-essential {
  background: transparent;
  color: #64748b;
  border: 1px solid rgba(100, 116, 139, 0.3);
  padding: 8px 16px;
  border-radius: 50px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.cookie-btn-essential:hover {
  border-color: rgba(100, 116, 139, 0.6);
  color: #94a3b8;
}

.cookie-btn-settings {
  background: transparent;
  color: #6c47ff;
  border: none;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  white-space: nowrap;
}

/* Cookie Settings Expanded Panel */
#cookieSettingsPanel {
  border-top: 1px solid rgba(108, 71, 255, 0.15);
  padding: 16px 24px;
  max-width: 1200px;
  margin: 0 auto;
  display: none;
}

.cookie-setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  gap: 12px;
}

.cookie-setting-info {
  flex: 1;
}

.cookie-setting-info strong {
  color: #e2e8f0;
  font-size: 13px;
  display: block;
}

.cookie-setting-info span {
  color: #64748b;
  font-size: 11px;
}

/* Toggle switch */
.cookie-toggle {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.cookie-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.cookie-toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #334155;
  border-radius: 24px;
  transition: 0.3s;
}

.cookie-toggle-slider:before {
  content: '';
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: 0.3s;
}

.cookie-toggle input:checked + .cookie-toggle-slider {
  background: linear-gradient(135deg, #6c47ff, #00d4ff);
}

.cookie-toggle input:checked + .cookie-toggle-slider:before {
  transform: translateX(20px);
}

.cookie-toggle input:disabled + .cookie-toggle-slider {
  opacity: 0.7;
  cursor: not-allowed;
}

.cookie-save-btn {
  margin-top: 14px;
  background: linear-gradient(135deg, #6c47ff, #00d4ff);
  color: #fff;
  border: none;
  padding: 9px 24px;
  border-radius: 50px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.2s;
}

.cookie-save-btn:hover { opacity: 0.9; }

/* ============================================================
   LEAD CAPTURE — FLOATING CTA BUTTON
   ============================================================ */
#leadCaptureFAB {
  position: fixed;
  bottom: 20px;
  right: 24px;
  z-index: 9500;
  background: linear-gradient(135deg, #6c47ff, #00d4ff);
  color: #fff;
  border: none;
  padding: 14px 20px;
  border-radius: 50px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 8px 32px rgba(108, 71, 255, 0.4);
  transition: transform 0.2s, box-shadow 0.2s;
  animation: fabPulse 3s ease-in-out infinite;
}

#leadCaptureFAB:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 12px 40px rgba(108, 71, 255, 0.55);
}

@keyframes fabPulse {
  0%, 100% { box-shadow: 0 8px 32px rgba(108, 71, 255, 0.4); }
  50%       { box-shadow: 0 8px 48px rgba(108, 71, 255, 0.7); }
}

#leadCaptureFAB i { font-size: 14px; }

/* ============================================================
   LEAD CAPTURE MODAL
   ============================================================ */
#leadCaptureModal {
  position: fixed;
  inset: 0;
  z-index: 9800;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

#leadCaptureModal.show {
  opacity: 1;
  pointer-events: all;
}

#leadCaptureModal.show .lead-modal-box {
  transform: scale(1) translateY(0);
}

.lead-modal-box {
  background: #111827;
  border: 1px solid rgba(108, 71, 255, 0.3);
  border-radius: 20px;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
  transform: scale(0.95) translateY(20px);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.lead-modal-header {
  background: linear-gradient(135deg, #6c47ff 0%, #00d4ff 100%);
  padding: 24px 28px 20px;
  position: relative;
}

.lead-modal-header h3 {
  color: #fff;
  font-size: 20px;
  font-weight: 800;
  margin: 0 0 4px;
}

.lead-modal-header p {
  color: rgba(255, 255, 255, 0.85);
  font-size: 13px;
  margin: 0;
}

.lead-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.lead-modal-close:hover { background: rgba(255, 255, 255, 0.3); }

.lead-modal-body {
  padding: 24px 28px;
}

.lead-modal-body .form-group {
  margin-bottom: 14px;
}

.lead-modal-body label {
  display: block;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.lead-modal-body .form-control {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #f1f5f9;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}

.lead-modal-body .form-control:focus {
  border-color: rgba(108, 71, 255, 0.5);
  box-shadow: 0 0 0 3px rgba(108, 71, 255, 0.1);
}

.lead-consent-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 16px 0;
}

.lead-consent-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin-top: 2px;
  accent-color: #6c47ff;
  cursor: pointer;
}

.lead-consent-row label {
  color: #64748b;
  font-size: 12px;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  margin: 0;
  line-height: 1.5;
  cursor: pointer;
}

.lead-consent-row label a {
  color: #6c47ff;
  text-decoration: none;
}

#leadSubmitBtn {
  width: 100%;
  background: linear-gradient(135deg, #6c47ff, #00d4ff);
  color: #fff;
  border: none;
  padding: 13px;
  border-radius: 50px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

#leadSubmitBtn:hover:not(:disabled) {
  opacity: 0.9;
  transform: translateY(-1px);
}

#leadSubmitBtn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

#leadFormError {
  display: none;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 12px;
}

#leadFormSuccess {
  display: none;
  text-align: center;
  padding: 24px;
}

#leadFormSuccess .success-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

#leadFormSuccess h4 {
  color: #4ade80;
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
}

#leadFormSuccess p {
  color: #94a3b8;
  font-size: 14px;
}

/* Admin Analytics Panel */
#panel-visitorAnalytics .analytics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.analytics-metric-box {
  background: rgba(108, 71, 255, 0.08);
  border: 1px solid rgba(108, 71, 255, 0.2);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
}

.analytics-metric-box .metric-value {
  font-size: 2rem;
  font-weight: 800;
  color: #1e40af;
  line-height: 1;
  margin-bottom: 6px;
}

.analytics-metric-box .metric-label {
  font-size: 12px;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.lead-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 50px;
  font-size: 11px;
  font-weight: 600;
}

.lead-status-badge.sent     { background: rgba(74, 222, 128, 0.15); color: #4ade80; }
.lead-status-badge.pending  { background: rgba(251, 191, 36, 0.15); color: #fbbf24; }
.lead-status-badge.failed   { background: rgba(239, 68, 68, 0.15);  color: #f87171; }
.lead-status-badge.skipped  { background: rgba(100, 116, 139, 0.15); color: #94a3b8; }

/* Responsive */
@media (max-width: 768px) {
  .cookie-banner-inner { padding: 16px; }
  .cookie-actions { width: 100%; justify-content: flex-start; }
  #leadCaptureFAB { bottom: 20px; right: 16px; font-size: 12px; padding: 12px 16px; }
  #panel-visitorAnalytics .analytics-grid { grid-template-columns: repeat(2, 1fr); }
  .lead-modal-box { border-radius: 16px; }
  .lead-modal-header, .lead-modal-body { padding: 20px; }
}

@media (max-width: 480px) {
  .cookie-btn-accept, .cookie-btn-essential { width: 100%; text-align: center; justify-content: center; }
  .lead-modal-box { border-radius: 12px 12px 0 0; align-self: flex-end; }
  #leadCaptureModal { align-items: flex-end; padding: 0; }
  #panel-visitorAnalytics .analytics-grid { grid-template-columns: 1fr 1fr; }
}
