:root {
  --bg: #050810;
  --surface: #0f172a;
  --surface-light: #1e293b;
  --text: #f8fafc;
  --text-muted: #94a3b8;
  --primary: #3b82f6;
  --primary-glow: rgba(59, 130, 246, 0.4);
  --secondary: #6366f1;
  --accent: #8b5cf6;
  --danger: #ef4444;
  --success: #10b981;
  --radius-xl: 32px;
  --radius-lg: 20px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --font-main: 'Plus Jakarta Sans', sans-serif;
  --font-display: 'Outfit', sans-serif;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-main);
  color: var(--text);
  background: var(--bg);
  background-image: 
    radial-gradient(circle at 20% 20%, rgba(59, 130, 246, 0.15) 0%, transparent 40%),
    radial-gradient(circle at 80% 80%, rgba(139, 92, 246, 0.15) 0%, transparent 40%);
  background-attachment: fixed;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 1rem; /* Reduced from 2rem 1rem to save space */
  line-height: 1.6;
}

.page {
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 3rem 2rem;
  border-radius: var(--radius-xl);
  box-shadow: 
    0 25px 50px -12px rgba(0, 0, 0, 0.5),
    inset 0 1px 1px rgba(255, 255, 255, 0.05);
  width: 100%;
  max-width: 900px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  animation: fadeIn 0.8s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Branding */
.brand-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 3.5rem;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  width: 100%;
}

.auth-header {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 0.5rem;
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.08);
  padding: 6px 14px;
  border-radius: 100px;
  font-size: 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-weight: 600;
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--primary);
}

.login-link {
  font-family: var(--font-display);
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9rem;
  background: rgba(255, 255, 255, 0.05);
  padding: 8px 16px;
  border-radius: 100px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.2s;
}

.login-link:hover {
  background: var(--primary);
  border-color: var(--primary);
}

.header-logo-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  user-select: none;
}

.header-logo-link:active {
  transform: scale(0.98);
}

.brand-header.compact {
  margin-bottom: 1.5rem;
  flex-direction: row;
  justify-content: space-between;
  gap: 0.75rem;
}

.brand-header.compact .logo-icon {
  font-size: 1.8rem;
  margin: 0;
}

.brand-header.compact .brand-name {
  font-size: 1.8rem;
}

.logo-icon {
  font-size: 3.5rem;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 15px var(--primary-glow));
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.brand-name {
  font-family: var(--font-display);
  font-size: 3.5rem;
  font-weight: 800;
  margin: 0;
  letter-spacing: -0.04em;
  background: linear-gradient(to right, #ffffff, #94a3b8);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Components */
button {
  font-family: var(--font-main);
  border: none;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  padding: 1rem 2rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px var(--primary-glow);
  filter: brightness(1.1);
}

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

button.secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text);
  box-shadow: none;
}

button.secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

/* Form Styles */
.route-form {
  display: grid;
  gap: 2rem;
}

.address-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.user-entry {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-lg);
  padding: 2rem;
  position: relative;
  transition: all 0.3s ease;
}

.user-entry:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(59, 130, 246, 0.2);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  position: relative;
}

.field span {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

input[type="text"],
input[type="number"],
input[type="time"] {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  color: var(--text);
  padding: 1rem 1.25rem;
  font-size: 1rem;
  width: 100%;
  transition: all 0.3s ease;
  font-family: inherit;
}

input:focus {
  outline: none;
  border-color: var(--primary);
  background: rgba(0, 0, 0, 0.4);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.field-row {
  flex-direction: row !important;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.short-input {
  width: 80px !important;
  text-align: center;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  font-weight: 600;
  color: var(--text-muted);
  transition: color 0.2s;
}

.checkbox-label:hover {
  color: var(--text);
}

input[type="checkbox"] {
  appearance: none;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  cursor: pointer;
  position: relative;
  transition: all 0.3s;
}

input[type="checkbox"]:checked {
  background: var(--primary);
  border-color: var(--primary);
}

input[type="checkbox"]:checked::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 14px;
}

/* Specific styling for Time Picker */
input[type="time"]::-webkit-calendar-picker-indicator {
  filter: invert(1);
  cursor: pointer;
  opacity: 0.6;
}

input[type="time"]::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
}

.big-input {
  background: rgba(255, 255, 255, 0.07) !important;
  color: var(--text) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.big-input:focus {
  background: rgba(255, 255, 255, 0.1) !important;
  border-color: var(--primary) !important;
}

.delete-user-btn {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  width: 36px;
  height: 36px;
  padding: 0;
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
  border-radius: 50%;
  box-shadow: none;
}

.delete-user-btn:hover {
  background: var(--danger);
  color: white;
}

.seat-control {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(255,255,255,0.06);
  border-radius: 20px;
  padding: 2px 6px;
}

.seat-btn {
  width: 22px;
  height: 22px;
  padding: 0;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 700;
  box-shadow: none;
  min-height: unset;
  line-height: 1;
}

.seat-btn:hover {
  background: var(--primary);
  color: white;
}

/* Autocomplete suggestions */
.suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  margin-top: 8px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.5);
  z-index: 2000;
  max-height: 280px;
  overflow-y: auto;
  display: none;
}

.suggestions.open {
  display: block;
}

.suggestion-item {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text);
  padding: 1rem;
  text-align: left;
  font-size: 0.9rem;
  border-radius: 0;
  box-shadow: none;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.suggestion-item:hover {
  background: rgba(255, 255, 255, 0.05);
  filter: none;
  transform: none;
}

/* Actions */
.route-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}

/* Map */
.map {
  margin-top: 3rem;
  height: 500px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

/* Progress bar */
.progress-container {
  margin-top: 1.5rem;
  height: 8px;
  background: rgba(255,255,255,0.05);
  border-radius: 100px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(to right, var(--primary), var(--accent));
  width: 0%;
  transition: width 0.3s ease;
}

/* Results Table */
.route-results {
  margin-top: 2.5rem;
  background: rgba(0,0,0,0.2);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255,255,255,0.05);
  overflow: hidden;
}

.route-table {
  width: 100%;
  border-collapse: collapse;
}

.route-table th {
  background: rgba(255,255,255,0.02);
  padding: 1.25rem 1.5rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  text-align: left;
}

.route-table td {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid rgba(255,255,255,0.05);
}

.route-table tr.best {
  background: rgba(59, 130, 246, 0.05);
}

.best-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: var(--primary);
  color: white;
  font-size: 0.7rem;
  font-weight: 800;
  border-radius: 100px;
  margin-bottom: 0.5rem;
}

/* External Link Buttons */
.gmaps-btn {
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s;
}

.gmaps-btn { background: rgba(59, 130, 246, 0.1); color: #60a5fa; }

.gmaps-btn.btn-full {
  background: linear-gradient(135deg, #4285F4, #34A853) !important;
  color: white !important;
  border: none !important;
  box-shadow: 0 4px 15px rgba(66, 133, 244, 0.3) !important;
}

.waze-btn.btn-full {
  background: linear-gradient(135deg, #33ccff, #2ab1e3) !important;
  color: white !important;
  border: none !important;
  box-shadow: 0 4px 15px rgba(51, 204, 255, 0.3) !important;
}

/* New Navigation Buttons Group */
.nav-buttons-group {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.btn-nav {
  flex: 1;
  padding: 1rem;
  border-radius: var(--radius-md);
  font-weight: 700;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  transition: all 0.3s ease;
}

.btn-nav.gmaps-btn {
  background: linear-gradient(135deg, #4285F4, #34A853);
  color: white;
}

.btn-nav.waze-btn {
  background: linear-gradient(135deg, #33ccff, #2ab1e3);
  color: white;
}

.user-greeting {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.pickup-info {
  font-size: 1.1rem;
  color: var(--text);
  line-height: 1.4;
}

.gmaps-btn:hover { background: var(--primary); color: white; }

/* Mobile Flow Styles */
.step-container {
  display: none;
  animation: slideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.step-container.active {
  display: block;
}

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

.mobile-card {
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: var(--radius-xl);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  margin-top: 1rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.mobile-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4);
}

#status-msg {
  min-height: 1.5rem;
  transition: all 0.3s ease;
  padding: 0 1rem;
}

.big-input {
  font-family: var(--font-display) !important;
  font-size: 1.15rem !important; /* Slightly smaller to save space */
  padding: 1rem 1.25rem !important; /* Slightly smaller to save space */
  border-radius: var(--radius-md) !important;
  width: 100%; /* Removed !important to allow inline overrides */
  box-sizing: border-box !important;
}

.btn-full {
  width: 100%;
  margin-top: 1rem;
  font-size: 1.1rem;
  padding: 1.2rem;
}

.whatsapp-btn {
  background: linear-gradient(135deg, #25d366, #128c7e) !important;
  box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3) !important;
  border: none !important;
}

.summary-item {
  margin-bottom: 1.25rem;
  padding: 1.25rem;
  border-left: 4px solid var(--primary);
  background: rgba(255, 255, 255, 0.02);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.summary-label {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.25rem;
}

.summary-val {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
}

.participants-list {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.participant-tag {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 100px;
  font-size: 0.9rem;
}

.participant-tag.is-driver {
  border: 1px solid var(--primary-glow);
  background: rgba(59, 130, 246, 0.1);
}

/* ── Sélecteur de rôle (step-2) ── */
.role-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.role-selector .role-card:last-child:nth-child(odd) {
  grid-column: 1 / -1;
}

.role-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1.25rem 1rem;
  border-radius: var(--radius-lg);
  border: 2px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--font-main);
  color: var(--text-muted);
}

.role-card:hover {
  border-color: rgba(59, 130, 246, 0.5);
  background: rgba(59, 130, 246, 0.06);
  color: var(--text);
}

.role-card.active {
  border-color: var(--primary);
  background: rgba(59, 130, 246, 0.15);
  color: var(--text);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12);
}

.role-icon {
  font-size: 2rem;
  line-height: 1;
}

.role-label {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

/* ── Compteur +/- (step-2) ── */
.counter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  padding: 0.875rem 1.1rem;
  margin-top: 0.75rem;
}

.counter-label {
  font-size: 0.9rem;
  color: var(--text);
  font-weight: 500;
}

.counter-widget {
  display: flex;
  align-items: center;
  gap: 0.875rem;
}

.counter-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--primary);
  background: transparent;
  color: var(--primary);
  font-size: 1.25rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  padding: 0;
  line-height: 1;
}

.counter-btn:hover {
  background: var(--primary);
  color: white;
}

.counter-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  border-color: var(--text-muted);
  color: var(--text-muted);
}

.counter-btn:disabled:hover {
  background: transparent;
  color: var(--text-muted);
}

.counter-display {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text);
  min-width: 2rem;
  text-align: center;
}

/* Passagers supplémentaires */
.passenger-row {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.passenger-row-header {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.passenger-row-header .big-input {
  flex: 1;
  margin: 0;
}

.remove-passenger-btn {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  font-size: 0.8rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.remove-passenger-btn:hover {
  background: var(--danger);
  color: white;
  border-color: var(--danger);
}

/* Base Responsive Fixes */
@media (max-width: 768px) {
  .page { padding: 1.5rem 1rem; }
  .brand-name { font-size: clamp(2rem, 10vw, 2.5rem); }
  .route-actions { flex-direction: column; }
  .route-actions button { width: 100%; }
  .route-results { overflow-x: auto; }
  
  .history-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  
  .history-item .btn-view-pool {
    width: 100%;
    text-align: center;
  }
  
  .mobile-card {
    padding: 1.25rem 1rem;
  }
}

@media (max-width: 480px) {
  body { padding: 0.5rem; }
  .page { padding: 1.25rem 0.75rem; border-radius: var(--radius-lg); }
  h2 { font-size: 1.5rem; }
}

.hidden { display: none !important; }

/* --- PROFIL & OVERLAY --- */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center; /* Centré par défaut */
    padding: 20px;
}

.profile-card {
    background: #1a1b1e;
    width: 100%;
    max-width: 500px;
    padding: 32px;
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.8);
    position: relative;
    max-height: 85vh;
    overflow-y: auto;
    border: 1px solid rgba(255,255,255,0.1);
    animation: modalPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalPop {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(255,255,255,0.1);
    border: none;
    color: white;
    font-size: 24px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
}

.history-list {
    margin: 16px 0;
}

.history-item {
  background: rgba(255,255,255,0.03);
  padding: 1rem;
  border-radius: var(--radius-md);
  margin-bottom: 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-left: 4px solid var(--primary);
}

.history-info strong {
    display: block;
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.history-info span {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.btn-view-pool {
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary);
    padding: 0.5rem 1rem;
    border-radius: 100px;
    font-size: 0.8rem;
    text-decoration: none;
    font-weight: 700;
    transition: all 0.2s;
}

.btn-view-pool:hover {
    background: var(--primary);
    color: white;
}

.btn-logout {
    display: block;
    text-align: center;
    padding: 1rem;
    color: #ff4d4d;
    text-decoration: none;
    font-weight: 700;
    margin-top: 1.5rem;
    background: rgba(255, 77, 77, 0.05);
    border-radius: var(--radius-md);
}

/* .auth-header merged above */

.btn-auth {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    background: var(--primary);
    color: white;
    padding: 6px 16px 6px 12px;
    border-radius: 100px;
    border: none;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: var(--font-body);
    transition: all 0.2s;
    text-decoration: none;
}

.btn-auth:hover {
    opacity: 0.85;
    transform: scale(1.03);
}

@media (max-width: 480px) {
    .btn-auth span { display: none; }
    .btn-auth { padding: 8px; }
}

.auth-user {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    background: rgba(255,255,255,0.05);
    padding: 4px 12px 4px 4px;
    border-radius: 100px;
    border: 1px solid rgba(255,255,255,0.1);
    transition: all 0.2s;
}

.auth-user:hover {
    background: rgba(255,255,255,0.1);
}

.auth-user img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

.auth-user span {
    font-weight: 600;
    font-size: 0.9rem;
}

.user-avatar-large {
    display: block;
    margin: 0 auto;
    object-fit: cover;
    box-shadow: 0 10px 25px var(--primary-glow);
}

@media (max-width: 600px) {
    .overlay {
        align-items: flex-end;
        padding: 0;
    }
    .profile-card {
        border-radius: 24px 24px 0 0;
        max-height: 90vh;
        animation: slideUp 0.3s ease-out;
    }
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

/* Shortcuts */
.address-shortcuts {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.btn-shortcut {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text);
  padding: 0.6rem 1rem;
  border-radius: 100px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
}

.btn-shortcut:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--primary);
  transform: translateY(-2px);
}

.btn-icon-shortcut {
    position: absolute;
    right: 0;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1.1rem;
}

.btn-icon-shortcut:hover {
    background: rgba(255,255,255,0.1);
    transform: rotate(180deg);
}

.btn-full.success {
    background: var(--success);
    color: white;
    border: none;
}

.btn-full.success:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
}

/* ==============================================
   SÉLECTEUR DE THÈME
   ============================================== */
.theme-section-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.theme-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.6rem;
}

.theme-swatch {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 0.4rem;
  background: rgba(255,255,255,0.04);
  border: 2px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: none;
  font-family: var(--font-main);
}

.theme-swatch:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  filter: none;
  box-shadow: 0 4px 12px var(--primary-glow);
}

.theme-swatch.active {
  border-color: var(--primary);
  background: rgba(59,130,246,0.08);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.theme-preview {
  display: block;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  flex-shrink: 0;
}

.theme-preview--default {
  background: conic-gradient(#050810 0deg 180deg, #3b82f6 180deg 270deg, #8b5cf6 270deg 360deg);
  border: 2px solid rgba(255,255,255,0.15);
}

.theme-preview--urban-light {
  background: conic-gradient(#f0f4ff 0deg 180deg, #2563eb 180deg 270deg, #7c3aed 270deg 360deg);
  border: 2px solid rgba(0,0,0,0.1);
}

.theme-preview--forest {
  background: conic-gradient(#0d1a0f 0deg 180deg, #4ade80 180deg 270deg, #fbbf24 270deg 360deg);
  border: 2px solid rgba(74,222,128,0.2);
}

.theme-preview--sunset {
  background: conic-gradient(#0e0a06 0deg 180deg, #f97316 180deg 270deg, #fbbf24 270deg 360deg);
  border: 2px solid rgba(249,115,22,0.2);
}

.theme-swatch-name {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-align: center;
  white-space: nowrap;
}

/* ==============================================
   THÈME : URBAN LIGHT
   ============================================== */
html[data-theme="urban-light"] {
  --bg: #f0f4ff;
  --surface: #ffffff;
  --surface-light: #f8faff;
  --text: #0f172a;
  --text-muted: #64748b;
  --primary: #2563eb;
  --primary-glow: rgba(37, 99, 235, 0.18);
  --secondary: #7c3aed;
  --accent: #0ea5e9;
  --danger: #dc2626;
  --success: #16a34a;
  --font-main: 'Inter', 'Plus Jakarta Sans', sans-serif;
  --font-display: 'Inter', 'Outfit', sans-serif;
}

html[data-theme="urban-light"] body {
  background: var(--bg);
  background-image: radial-gradient(ellipse 80% 50% at 50% -10%, rgba(37,99,235,0.07) 0%, transparent 60%);
}

html[data-theme="urban-light"] .page {
  background: #ffffff;
  border-color: rgba(0,0,0,0.07);
  box-shadow: 0 8px 40px rgba(0,0,0,0.08), 0 1px 3px rgba(0,0,0,0.04);
}

html[data-theme="urban-light"] .brand-name {
  background: linear-gradient(to right, #0f172a, #475569);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

html[data-theme="urban-light"] .mobile-card {
  background: rgba(0,0,0,0.02);
  border-color: rgba(0,0,0,0.06);
  box-shadow: 0 4px 16px rgba(0,0,0,0.05);
}

html[data-theme="urban-light"] .mobile-card:hover {
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}

html[data-theme="urban-light"] button.secondary {
  background: rgba(0,0,0,0.04);
  border: 1px solid rgba(0,0,0,0.1);
  color: var(--text);
  box-shadow: none;
}

html[data-theme="urban-light"] button.secondary:hover {
  background: rgba(0,0,0,0.07);
  border-color: rgba(0,0,0,0.15);
}

html[data-theme="urban-light"] input[type="text"],
html[data-theme="urban-light"] input[type="number"],
html[data-theme="urban-light"] input[type="time"],
html[data-theme="urban-light"] .big-input {
  background: rgba(0,0,0,0.03) !important;
  border-color: rgba(0,0,0,0.1) !important;
  color: var(--text) !important;
}

html[data-theme="urban-light"] input[type="checkbox"] {
  border-color: rgba(0,0,0,0.2);
}

html[data-theme="urban-light"] input[type="time"]::-webkit-calendar-picker-indicator {
  filter: none;
  opacity: 0.5;
}

html[data-theme="urban-light"] .suggestions {
  background: #ffffff;
  border-color: rgba(0,0,0,0.1);
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}

html[data-theme="urban-light"] .suggestion-item {
  color: var(--text);
  border-bottom-color: rgba(0,0,0,0.05);
}

html[data-theme="urban-light"] .suggestion-item:hover {
  background: rgba(0,0,0,0.04);
}

html[data-theme="urban-light"] .history-item {
  background: rgba(0,0,0,0.02);
}

html[data-theme="urban-light"] .role-card {
  border-color: rgba(0,0,0,0.1);
  background: rgba(0,0,0,0.02);
  color: var(--text-muted);
}

html[data-theme="urban-light"] .role-card.active {
  border-color: var(--primary);
  background: rgba(37, 99, 235, 0.1);
  color: var(--primary);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.18), inset 0 0 0 1px rgba(37, 99, 235, 0.25);
}

html[data-theme="urban-light"] .role-card.active .role-label {
  color: var(--primary);
}

html[data-theme="urban-light"] .role-card:hover:not(.active) {
  border-color: rgba(37, 99, 235, 0.35);
  background: rgba(37, 99, 235, 0.04);
}

html[data-theme="urban-light"] .counter-row {
  background: rgba(0,0,0,0.02);
  border-color: rgba(0,0,0,0.08);
}

html[data-theme="urban-light"] .user-entry {
  background: rgba(0,0,0,0.02);
  border-color: rgba(0,0,0,0.05);
}

html[data-theme="urban-light"] .login-link,
html[data-theme="urban-light"] .user-badge {
  background: rgba(0,0,0,0.04);
  border-color: rgba(0,0,0,0.1);
  color: var(--text);
}

html[data-theme="urban-light"] .btn-shortcut {
  background: rgba(0,0,0,0.04);
  border-color: rgba(0,0,0,0.1);
  color: var(--text);
}

html[data-theme="urban-light"] .driver-options {
  background: rgba(0,0,0,0.02) !important;
}

html[data-theme="urban-light"] .theme-swatch {
  background: rgba(0,0,0,0.03);
  border-color: rgba(0,0,0,0.08);
}

html[data-theme="urban-light"] .theme-swatch.active {
  background: rgba(37,99,235,0.06);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.15);
}

/* ==============================================
   THÈME : FOREST
   ============================================== */
html[data-theme="forest"] {
  --bg: #0d1a0f;
  --surface: #132118;
  --surface-light: #1a2e1f;
  --text: #e8f5e3;
  --text-muted: #7a9e7e;
  --primary: #4ade80;
  --primary-glow: rgba(74, 222, 128, 0.25);
  --secondary: #86efac;
  --accent: #fbbf24;
  --danger: #f87171;
  --success: #4ade80;
  --font-main: 'DM Sans', 'Plus Jakarta Sans', sans-serif;
  --font-display: 'Fraunces', 'Outfit', serif;
}

html[data-theme="forest"] body {
  background: var(--bg);
  background-image:
    radial-gradient(circle at 20% 20%, rgba(74,222,128,0.08) 0%, transparent 40%),
    radial-gradient(circle at 80% 80%, rgba(22,163,74,0.06) 0%, transparent 40%);
}

html[data-theme="forest"] .page {
  background: rgba(19, 33, 24, 0.92);
  border-color: rgba(74,222,128,0.1);
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.6), inset 0 1px 1px rgba(74,222,128,0.05);
}

html[data-theme="forest"] .brand-name {
  background: linear-gradient(to right, #e8f5e3, #4ade80);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

html[data-theme="forest"] .logo-icon {
  filter: drop-shadow(0 0 15px rgba(74,222,128,0.4));
}

html[data-theme="forest"] button {
  background: linear-gradient(135deg, #16a34a, #4ade80);
  color: #0d1a0f;
  box-shadow: 0 4px 15px rgba(74,222,128,0.25);
}

html[data-theme="forest"] button:hover:not(:disabled) {
  box-shadow: 0 8px 25px rgba(74,222,128,0.35);
}

html[data-theme="forest"] button.secondary {
  background: rgba(74,222,128,0.06);
  border: 1px solid rgba(74,222,128,0.15);
  color: var(--text);
  box-shadow: none;
}

html[data-theme="forest"] button.secondary:hover {
  background: rgba(74,222,128,0.12);
  border-color: rgba(74,222,128,0.3);
}

html[data-theme="forest"] .mobile-card {
  background: rgba(74,222,128,0.03);
  border-color: rgba(74,222,128,0.08);
}

html[data-theme="forest"] input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(74,222,128,0.1);
}

html[data-theme="forest"] .role-card.active {
  border-color: var(--primary);
  background: rgba(74,222,128,0.12);
  box-shadow: 0 0 0 4px rgba(74,222,128,0.1);
}

html[data-theme="forest"] .history-item {
  border-left-color: var(--primary);
}

html[data-theme="forest"] .theme-swatch.active {
  border-color: #4ade80;
  background: rgba(74,222,128,0.08);
  box-shadow: 0 0 0 3px rgba(74,222,128,0.2);
}

/* ==============================================
   THÈME : SUNSET
   ============================================== */
html[data-theme="sunset"] {
  --bg: #0e0a06;
  --surface: #16100a;
  --surface-light: #1e1610;
  --text: #fef3e2;
  --text-muted: #a08060;
  --primary: #f97316;
  --primary-glow: rgba(249, 115, 22, 0.3);
  --secondary: #fb923c;
  --accent: #fbbf24;
  --danger: #f43f5e;
  --success: #34d399;
  --font-main: 'Sora', 'Plus Jakarta Sans', sans-serif;
  --font-display: 'Sora', 'Outfit', sans-serif;
}

html[data-theme="sunset"] body {
  background: var(--bg);
  background-image:
    radial-gradient(circle at 20% 20%, rgba(249,115,22,0.1) 0%, transparent 40%),
    radial-gradient(circle at 80% 80%, rgba(251,191,36,0.08) 0%, transparent 40%);
}

html[data-theme="sunset"] .page {
  background: rgba(22, 16, 10, 0.92);
  border-color: rgba(249,115,22,0.1);
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.6), inset 0 1px 1px rgba(249,115,22,0.05);
}

html[data-theme="sunset"] .brand-name {
  background: linear-gradient(to right, #fef3e2, #f97316);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

html[data-theme="sunset"] .logo-icon {
  filter: drop-shadow(0 0 15px rgba(249,115,22,0.5));
}

html[data-theme="sunset"] button {
  background: linear-gradient(135deg, #f97316, #fbbf24);
  color: #0e0a06;
  box-shadow: 0 4px 15px rgba(249,115,22,0.3);
}

html[data-theme="sunset"] button:hover:not(:disabled) {
  box-shadow: 0 8px 25px rgba(249,115,22,0.4);
}

html[data-theme="sunset"] button.secondary {
  background: rgba(249,115,22,0.06);
  border: 1px solid rgba(249,115,22,0.15);
  color: var(--text);
  box-shadow: none;
}

html[data-theme="sunset"] button.secondary:hover {
  background: rgba(249,115,22,0.12);
  border-color: rgba(249,115,22,0.3);
}

html[data-theme="sunset"] .mobile-card {
  background: rgba(249,115,22,0.03);
  border-color: rgba(249,115,22,0.08);
}

html[data-theme="sunset"] input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(249,115,22,0.1);
}

html[data-theme="sunset"] .role-card.active {
  border-color: var(--primary);
  background: rgba(249,115,22,0.12);
  box-shadow: 0 0 0 4px rgba(249,115,22,0.1);
}

html[data-theme="sunset"] .history-item {
  border-left-color: var(--primary);
}

html[data-theme="sunset"] .theme-swatch.active {
  border-color: #f97316;
  background: rgba(249,115,22,0.08);
  box-shadow: 0 0 0 3px rgba(249,115,22,0.2);
}

/* ==============================================
   BOUTON TOGGLE NOTIFICATIONS (PROFIL)
   ============================================== */

.btn-notif-toggle {
    flex-shrink: 0;
    padding: 0.4rem 1rem;
    border-radius: 100px;
    border: 1px solid var(--primary);
    background: transparent;
    color: var(--primary);
    font-size: 0.8rem;
    font-weight: 600;
    font-family: var(--font-main);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.btn-notif-toggle:hover {
    background: var(--primary);
    color: white;
}

.btn-notif-toggle.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.btn-notif-toggle.active:hover {
    background: transparent;
    color: var(--primary);
}

/* ==============================================
   ACTIONS BAS DE PAGE STEP-3
   ============================================== */

.pool-actions-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255,255,255,0.07);
}

.btn-pool-action {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.7rem 1rem;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  font-family: var(--font-main);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.btn-pool-action:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.16);
  color: var(--text);
}

.btn-pool-action--danger {
  color: var(--danger);
  border-color: rgba(239,68,68,0.2);
}

.btn-pool-action--danger:hover {
  background: rgba(239,68,68,0.08);
  border-color: rgba(239,68,68,0.4);
  color: var(--danger);
}

html[data-theme="urban-light"] .pool-actions-group {
  border-top-color: rgba(0,0,0,0.08);
}

html[data-theme="urban-light"] .btn-pool-action {
  background: rgba(0,0,0,0.03);
  border-color: rgba(0,0,0,0.09);
  color: var(--text-muted);
}

html[data-theme="urban-light"] .btn-pool-action:hover {
  background: rgba(0,0,0,0.06);
  border-color: rgba(0,0,0,0.15);
  color: var(--text);
}

html[data-theme="urban-light"] .btn-pool-action--danger {
  border-color: rgba(220,38,38,0.2);
  color: var(--danger);
}

html[data-theme="urban-light"] .btn-pool-action--danger:hover {
  background: rgba(220,38,38,0.06);
  border-color: rgba(220,38,38,0.35);
}

/* ==============================================
   BANDEAU COOKIES & MODAL CONFIDENTIALITÉ
   ============================================== */

.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9000;
  padding: 1rem;
  background: rgba(15, 23, 42, 0.97);
  border-top: 1px solid rgba(59, 130, 246, 0.3);
  backdrop-filter: blur(12px);
  animation: slide-up 0.3s ease;
}

@keyframes slide-up {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0);   opacity: 1; }
}

.cookie-banner-content {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.cookie-banner-content p {
  margin: 0;
  flex: 1;
  font-size: 0.875rem;
  color: var(--text-muted);
  min-width: 200px;
}

.cookie-link {
  background: none;
  border: none;
  padding: 0;
  color: var(--primary);
  cursor: pointer;
  font-size: inherit;
  font-family: inherit;
  text-decoration: underline;
  display: inline;
}

.btn-cookie-ok {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  padding: 0.5rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  font-family: var(--font-main);
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.2s;
}

.btn-cookie-ok:hover { opacity: 0.85; }

/* Modal confidentialité */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9100;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-box {
  background: var(--surface);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-xl);
  padding: 2rem;
  max-width: 600px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 25px 60px rgba(0,0,0,0.6);
}

.privacy-content h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  margin: 1.5rem 0 0.5rem;
  color: var(--text);
}

.privacy-content p,
.privacy-content li {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0.25rem 0;
}

.privacy-content ul {
  padding-left: 1.25rem;
}

.privacy-content code {
  background: rgba(255,255,255,0.06);
  padding: 0.1em 0.4em;
  border-radius: 4px;
  font-size: 0.85em;
}
