/* ========== RESET & VARIABLES ========== */
:root {
  --primary: #0f3b5e;
  --primary-light: #1a5a8a;
  --accent: #e6a23c;
  --accent-hover: #d18e2c;
  --bg: #f9fafb;
  --surface: #ffffff;
  --text: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --shadow: 0 4px 20px rgba(0,0,0,0.06);
  --radius: 12px;
  --transition: 0.25s ease;
}

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

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ========== HEADER ========== */
.main-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
}
.logo {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.logo-icon {
  font-size: 2rem;
}
.nav-list {
  display: flex;
  list-style: none;
  gap: 28px;
}
.nav-list a {
  text-decoration: none;
  color: var(--text);
  font-weight: 500;
  transition: color var(--transition);
}
.nav-list a:hover {
  color: var(--primary);
}

/* ========== BOUTONS ========== */
.btn-header, .btn-primary, .btn-accent, .btn-estimate {
  background: var(--accent);
  color: #fff;
  padding: 10px 24px;
  border-radius: 30px;
  text-decoration: none;
  font-weight: 600;
  transition: background var(--transition), transform var(--transition);
  display: inline-block;
  border: none;
  cursor: pointer;
}
.btn-header:hover, .btn-primary:hover, .btn-accent:hover, .btn-estimate:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}
.btn-estimate {
  background: var(--primary);
}
.btn-estimate:hover {
  background: var(--primary-light);
}

/* ========== HERO & CARDS ========== */
.hero {
  padding: 50px 0 60px;
  text-align: center;
}
.hero h1 {
  font-size: 2.8rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 12px;
}
.hero p {
  font-size: 1.2rem;
  color: var(--text-muted);
  max-width: 650px;
  margin: 0 auto 32px;
}

.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px;
  margin-bottom: 30px;
}

.form-group {
  margin-bottom: 18px;
}
.form-group label {
  display: block;
  font-weight: 500;
  margin-bottom: 6px;
}
.form-group input,
.form-group select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  background: #fff;
  transition: border var(--transition);
}
.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(15,59,94,0.1);
}

/* ========== RÉSULTAT ESTIMATION ========== */
.result-box {
  margin-top: 24px;
  padding: 20px;
  background: #f0f7ff;
  border-radius: var(--radius);
  border-left: 5px solid var(--primary);
  display: none;
}
.result-price {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
}
.price-range {
  color: var(--text-muted);
  font-size: 1.1rem;
}
.lead-form {
  margin-top: 20px;
  display: none;
}
.lead-form input {
  margin-bottom: 12px;
}
.success-msg {
  display: none;
  background: #e6f7e6;
  color: #1e4620;
  padding: 16px;
  border-radius: 8px;
  margin-top: 20px;
}

/* ========== FEATURES ========== */
.features {
  padding: 70px 0;
  background: var(--surface);
}
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 32px;
  margin-top: 30px;
}
.feature-item {
  text-align: center;
  padding: 20px;
}
.feature-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
}
.feature-item h3 {
  margin-bottom: 8px;
  color: var(--primary);
}

/* ========== MAP ========== */
#mapContainer {
  height: 400px;
  margin: 20px 0;
  border-radius: var(--radius);
  overflow: hidden;
  display: none;
}

/* ========== FOOTER ========== */
.main-footer {
  background: var(--primary);
  color: #fff;
  padding: 40px 0 20px;
  margin-top: auto;
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 30px;
  margin-bottom: 30px;
}
.footer-col h4 {
  font-size: 1.1rem;
  margin-bottom: 16px;
  font-weight: 600;
}
.footer-col ul {
  list-style: none;
}
.footer-col ul li {
  margin-bottom: 8px;
}
.footer-col a {
  color: #cbd5e1;
  text-decoration: none;
  transition: color var(--transition);
}
.footer-col a:hover {
  color: #fff;
}
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.2);
  padding-top: 20px;
  text-align: center;
  font-size: 0.9rem;
  color: #cbd5e1;
}
.social-links a {
  display: inline-block;
  margin: 0 8px;
  font-size: 1.4rem;
  color: #cbd5e1;
  transition: color var(--transition);
}
.social-links a:hover {
  color: #fff;
}

/* ========== PAGE AGENCES ========== */
.auth-card {
  max-width: 600px;
  margin: 50px auto;
}
.tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}
.tabs button {
  flex: 1;
  padding: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  cursor: pointer;
  font-weight: 600;
  border-radius: 8px 8px 0 0;
}
.tabs button.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.form-panel {
  display: none;
}
.form-panel.active {
  display: block;
}
.price-box {
  background: #f0f7ff;
  padding: 20px;
  border-radius: var(--radius);
  margin-bottom: 20px;
}
.badge {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 0.8rem;
  margin-left: 8px;
}

/* ========== TABLEAU DE BORD ========== */
.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 30px 0;
  flex-wrap: wrap;
  gap: 10px;
}
.stats-box {
  display: flex;
  gap: 20px;
  margin-bottom: 30px;
  flex-wrap: wrap;
}
.stat-card {
  background: var(--surface);
  padding: 20px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  flex: 1;
  min-width: 150px;
  text-align: center;
}
.stat-number {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
}

/* Tableau des leads */
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  margin-top: 20px;
}
th, td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
th {
  background: var(--primary);
  color: #fff;
}

/* Statuts des leads */
.status-badge {
  padding: 4px 8px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  display: inline-block;
}
.status-badge.new { background: #e0f2fe; color: #0369a1; }
.status-badge.contacted { background: #fef3c7; color: #92400e; }
.status-badge.converted { background: #dcfce7; color: #166534; }
.status-badge.lost { background: #fee2e2; color: #991b1b; }

/* Barre de filtres */
.filter-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.filter-bar select,
.filter-bar button {
  padding: 10px 15px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-family: inherit;
  font-size: 0.95rem;
  cursor: pointer;
}
.filter-bar button {
  background: var(--accent);
  color: #fff;
  border: none;
  font-weight: 600;
}
.filter-bar button:hover {
  background: var(--accent-hover);
}

/* Bandeaux spéciaux */
.free-alert {
  background: #fef3c7;
  padding: 15px;
  border-radius: var(--radius);
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}
.free-alert button {
  margin-left: 15px;
}
.trial-banner {
  background: #e0f2fe;
  padding: 10px;
  text-align: center;
  border-radius: 8px;
  margin-bottom: 20px;
}

/* Boutons d'action */
.action-btns button {
  margin-right: 5px;
  font-size: 0.9rem;
  padding: 6px 12px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 15px;
  cursor: pointer;
  transition: background var(--transition);
}
.action-btns button:hover {
  background: var(--primary-light);
}

.logout {
  color: #ef4444;
  cursor: pointer;
  background: none;
  border: none;
  font-weight: 600;
}
.upgrade-btn {
  cursor: pointer;
}

/* ========== PAGES LOCALES (villes) ========== */
/* Tableau des prix (peut utiliser le même style que table) */
.faq {
  margin: 40px 0;
}
.faq h2 {
  color: var(--primary);
  margin-bottom: 20px;
}
details {
  margin-bottom: 10px;
  background: var(--surface);
  padding: 12px 16px;
  border-radius: 8px;
  box-shadow: var(--shadow);
}
summary {
  font-weight: 600;
  cursor: pointer;
  outline: none;
}

/* Fil d'Ariane */
nav[aria-label="fil d'ariane"] ol {
  list-style: none;
  padding: 0;
  margin-bottom: 20px;
  font-size: 0.9rem;
}
nav[aria-label="fil d'ariane"] li {
  display: inline;
}
nav[aria-label="fil d'ariane"] a {
  color: var(--primary);
  text-decoration: none;
}
nav[aria-label="fil d'ariane"] a:hover {
  text-decoration: underline;
}

/* Liens inter-villes */
.city-links {
  margin-top: 40px;
  padding: 20px;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.city-links p {
  font-weight: 600;
  margin-bottom: 10px;
}
.city-links a {
  color: var(--primary);
  text-decoration: none;
  margin-right: 5px;
}
.city-links a:hover {
  text-decoration: underline;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
  .header-inner {
    flex-direction: column;
    height: auto;
    padding: 15px 0;
    gap: 10px;
  }
  .nav-list {
    gap: 16px;
    flex-wrap: wrap;
    justify-content: center;
  }
  .hero h1 {
    font-size: 2rem;
  }
  .dashboard-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .stats-box {
    flex-direction: column;
  }
  .filter-bar {
    flex-direction: column;
  }
  .free-alert {
    flex-direction: column;
    align-items: flex-start;
  }
  .free-alert button {
    margin-left: 0;
    margin-top: 10px;
  }
}