/* ============================================================
   Estim'Immo — Feuille de style v6 (professionnelle)
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:opsz,wght@14..32,300..800&display=swap');

:root {
  --bg-main:         #f6f9fc;
  --bg-card:         #ffffff;
  --bg-subtle:       #f1f5f9;
  --text-dark:       #0b1a33;
  --text-mid:        #334155;
  --text-light:      #94a3b8;
  --brand:           #0f6b4a;
  --brand-dark:      #064e3b;
  --brand-mid:       #0d9488;
  --brand-light:     #34d399;
  --brand-soft:      #ecfdf5;
  --border:          #e2e8f0;
  --border-strong:   #cbd5e1;
  --radius:          16px;
  --shadow-card:     0 8px 30px rgba(0,0,0,0.05), 0 2px 8px rgba(0,0,0,0.02);
  --shadow-hover:    0 16px 48px rgba(0,0,0,0.08), 0 4px 12px rgba(0,0,0,0.03);
  --header-h:        72px;
  --max-w:           1000px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg-main);
  color: var(--text-dark);
  line-height: 1.6;
  padding: 0 0 60px;
  -webkit-font-smoothing: antialiased;
}
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 24px; }

/* ---- Header amélioré ---- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  height: var(--header-h);
  background: rgba(255,255,255,0.92);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid rgba(226,232,240,0.6);
  box-shadow: 0 1px 0 rgba(0,0,0,0.02);
}
.site-header-inner {
  max-width: var(--max-w); margin: 0 auto; height: 100%;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px;
}
.site-logo {
  display: flex; align-items: center; gap: 8px;
  font-size: 20px; font-weight: 800; color: var(--text-dark);
  text-decoration: none; letter-spacing: -0.3px;
}
.site-logo-mark {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--brand-dark), var(--brand-mid));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 18px; box-shadow: 0 4px 8px rgba(6,78,59,0.2);
}
.site-logo-accent { color: var(--brand); }
.site-nav { display: flex; align-items: center; gap: 12px; }
.site-nav-link {
  font-size: 14px; font-weight: 600; color: var(--text-mid);
  padding: 8px 16px; border-radius: 30px; text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.site-nav-link:hover { background: var(--bg-subtle); color: var(--text-dark); }
.site-nav-link.is-cta {
  background: linear-gradient(135deg, var(--brand-dark), var(--brand-mid));
  color: white; box-shadow: 0 2px 8px rgba(6,78,59,0.25);
}
.site-nav-link.is-cta:hover { opacity: 0.92; }

/* ---- Trust badge (remplacement du badge "sans email") ---- */
.trust-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 600; color: var(--text-mid);
  background: var(--bg-subtle); padding: 6px 14px;
  border-radius: 30px; border: 1px solid var(--border);
}
.trust-badge svg { width: 18px; height: 18px; fill: var(--brand); }

/* ---- Breadcrumb ---- */
.breadcrumb {
  display: flex; flex-wrap: wrap; gap: 4px 8px;
  font-size: 13px; font-weight: 500; color: var(--text-light);
  margin: 20px 0 12px;
}
.breadcrumb a { color: var(--text-light); text-decoration: none; }
.breadcrumb a:hover { color: var(--brand); }
.bc-sep { color: var(--border-strong); }

/* ---- Page header ---- */
.page-header { margin: 16px 0 32px; }
.page-header h1 {
  font-size: clamp(26px, 5vw, 36px); font-weight: 800;
  line-height: 1.2; letter-spacing: -0.5px;
}
.page-header h1 .subtitle {
  display: block; font-size: 50%; font-weight: 500;
  color: var(--text-mid); margin-top: 4px;
}
.header-meta { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0 8px; }

.prix-median-rue {
  font-size: 15px; color: var(--text-mid); margin: 8px 0 6px;
}
.prix-median-rue strong { color: var(--text-dark); font-weight: 700; }
.back-link { margin: 4px 0 0; }
.back-link a { color: var(--brand); font-weight: 600; text-decoration: none; }

/* ---- Layout estimateur + pubs ---- */
.estimator-layout-wrapper {
  display: grid; grid-template-columns: 1fr; gap: 24px;
  margin: 24px 0 40px;
}
@media (min-width: 1080px) {
  .estimator-layout-wrapper {
    grid-template-columns: 160px 1fr 160px; align-items: start; gap: 32px;
  }
  .ad-placement-a { grid-column: 1; }
  .card-estimator  { grid-column: 2; }
  .ad-placement-b { grid-column: 3; }
}
.ad-slot {
  background: var(--bg-subtle); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 80px;
}
.ad-label { font-size: 10px; text-transform: uppercase; color: var(--text-light); letter-spacing: 0.8px; }

/* ---- Carte estimateur ---- */
.card-estimator {
  background: var(--bg-card); border-radius: var(--radius);
  border: 1px solid var(--border); padding: 32px 28px;
  box-shadow: var(--shadow-card); transition: box-shadow 0.2s;
}
.card-estimator:hover { box-shadow: var(--shadow-hover); }
.estimator-title { font-size: 20px; font-weight: 700; margin: 0 0 18px; }

.mode-toggle {
  display: inline-flex; padding: 4px; background: var(--bg-subtle);
  border-radius: 40px; margin-bottom: 24px; gap: 2px;
  border: 1px solid var(--border);
}
.mode-toggle-btn {
  border: none; background: transparent; color: var(--text-mid);
  font-size: 14px; font-weight: 600; padding: 8px 20px;
  border-radius: 40px; cursor: pointer;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}
.mode-toggle-btn.is-active {
  background: white; color: var(--brand-dark);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.mode-toggle-btn:hover:not(.is-active) { background: rgba(0,0,0,0.03); }

.form-section { margin-bottom: 22px; }
.fieldset-inline, .fieldset-checkboxes {
  border: 1px solid var(--border); border-radius: 12px;
  padding: 16px 18px; margin-bottom: 20px; background: var(--bg-subtle);
}
legend { font-size: 12px; font-weight: 700; color: var(--text-mid); text-transform: uppercase; letter-spacing: 0.5px; padding: 0 6px; }
.radio-label { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 500; cursor: pointer; margin-right: 24px; }
.radio-label input { accent-color: var(--brand); }

.form-grid {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 18px;
  margin-bottom: 20px;
}
@media (max-width: 720px) { .form-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .form-grid { grid-template-columns: 1fr; } }
.form-field label {
  display: block; font-size: 12px; font-weight: 700; color: var(--text-mid);
  text-transform: uppercase; letter-spacing: 0.4px; margin-bottom: 6px;
}
.form-field input, .form-field select {
  width: 100%; padding: 10px 12px;
  border: 1.5px solid var(--border); border-radius: 10px;
  font-size: 15px; font-family: inherit; background: var(--bg-card);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form-field input:focus, .form-field select:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(15,107,74,0.15);
}
.checkbox-grid {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-top: 8px;
}
@media (max-width: 440px) { .checkbox-grid { grid-template-columns: 1fr 1fr; } }
.check-label {
  display: flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 500; cursor: pointer;
  padding: 6px 10px; border-radius: 8px; border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s;
}
.check-label:hover { background: var(--brand-soft); border-color: rgba(15,107,74,0.15); }
.check-label input { accent-color: var(--brand); width: 16px; height: 16px; }

.btn-estimer {
  width: 100%; padding: 16px;
  background: linear-gradient(135deg, var(--brand-dark), var(--brand-mid));
  color: white; font-size: 16px; font-weight: 700;
  border: none; border-radius: 12px; cursor: pointer;
  box-shadow: 0 4px 16px rgba(6,78,59,0.3);
  transition: opacity 0.2s, transform 0.15s;
}
.btn-estimer:hover:not(:disabled) { opacity: 0.92; transform: translateY(-2px); }
.btn-estimer:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---- Résultat ---- */
.result-box {
  background: linear-gradient(145deg, var(--brand-dark) 0%, #0b4b3b 100%);
  color: white; border-radius: 16px; padding: 28px 24px;
  margin-top: 24px; text-align: center; position: relative;
  box-shadow: 0 8px 24px rgba(6,78,59,0.25);
}
.result-label { font-size: 12px; opacity: 0.7; letter-spacing: 1px; text-transform: uppercase; }
.price-median-row { display: flex; align-items: baseline; justify-content: center; gap: 8px; margin: 8px 0; }
.price-median {
  font-size: 38px; font-weight: 800; letter-spacing: -1px; line-height: 1;
}
.price-median-suffix { font-size: 16px; font-weight: 600; opacity: 0.7; }
.price-bounds {
  display: flex; align-items: center; justify-content: center; gap: 20px; margin: 6px 0 12px;
}
.price-bound { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.price-bound-label { font-size: 10px; text-transform: uppercase; opacity: 0.5; letter-spacing: 0.6px; }
.price-bound-value { font-size: 16px; font-weight: 700; color: var(--brand-light); }
.price-bound-sep { width: 1px; height: 30px; background: rgba(255,255,255,0.2); }

.ventes-ref { font-size: 13px; opacity: 0.7; margin: 4px 0; }
.source-badge { display: inline-block; font-size: 12px; font-weight: 700; padding: 4px 14px; border-radius: 40px; margin-top: 6px; }
.source-badge.immeuble { background: rgba(52,211,153,0.2); color: #26653d; border: 1px solid rgba(134,239,172,0.3); }
.source-badge.rue      { background: rgba(56,189,248,0.15); color: #7dd3fc; border: 1px solid rgba(125,211,252,0.3); }
.source-badge.voisins  { background: rgba(251,191,36,0.15); color: #fde68a; border: 1px solid rgba(253,230,138,0.3); }

.error-box { background: #fee2e2; color: #b91c1c; padding: 12px; border-radius: 10px; margin-top: 12px; display: none; }

.loyer-associe {
  margin-top: 16px; padding-top: 16px; border-top: 1px solid rgba(255,255,255,0.15);
  display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; font-size: 14px;
}
.loyer-associe-label { opacity: 0.7; }
.loyer-associe-valeur { font-weight: 700; color: var(--brand-light); font-size: 16px; }
.loyer-associe-rendement { opacity: 0.6; font-size: 13px; }

.loading-overlay {
  position: absolute; inset: 0; background: rgba(255,255,255,0.92);
  border-radius: 16px; z-index: 5; display: none;
  flex-direction: column; align-items: center; justify-content: center; gap: 14px;
}
.loading-overlay.active { display: flex; }
.loading-spinner { width: 40px; height: 40px; border: 4px solid var(--border); border-top-color: var(--brand); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { font-weight: 600; color: var(--text-dark); }
.loading-steps { display: flex; gap: 6px; }
.loading-steps span { width: 8px; height: 8px; border-radius: 50%; background: var(--border); transition: background 0.3s; }
.loading-steps span.done { background: var(--brand); }
.loading-steps span.active { background: var(--brand-dark); }

/* ---- Tableau des ventes ---- */
.table-wrapper { overflow-x: auto; margin: 16px 0 24px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 11px; text-transform: uppercase; color: var(--text-mid); padding: 10px 12px; border-bottom: 2px solid var(--border); background: var(--bg-subtle); }
td { padding: 10px 12px; border-bottom: 1px solid var(--border); }
tr:nth-child(even) td { background: #fafbfc; }
tr:hover td { background: #f1f8ff; }

/* ---- Page recherche ---- */
.search-hero {
  text-align: center; margin: 40px 0 32px;
}
.search-hero h1 { font-size: clamp(28px, 6vw, 40px); font-weight: 800; letter-spacing: -0.5px; line-height: 1.15; }
.search-hero h1 em { font-style: normal; color: var(--brand); }
.search-hero p { color: var(--text-mid); font-size: 17px; margin-top: 8px; }
.search-box {
  position: relative; max-width: 600px; margin: 24px auto 0;
}
.search-box input[type="text"] {
  width: 100%; padding: 16px 20px 16px 48px;
  font-size: 16px; border: 2px solid var(--border); border-radius: 40px;
  background: white; box-shadow: var(--shadow-card);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.search-box input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px rgba(15,107,74,0.1), var(--shadow-card); }
.search-results {
  position: absolute; left: 0; right: 0; top: calc(100% + 8px);
  background: white; border: 1px solid var(--border); border-radius: 16px;
  box-shadow: var(--shadow-hover); overflow: hidden; display: none; z-index: 20;
}
.search-results.active { display: block; }
.search-result-item {
  display: block; width: 100%; text-align: left; padding: 12px 18px;
  border: none; background: transparent; cursor: pointer;
  border-bottom: 1px solid var(--border); font-size: 14px; font-family: inherit;
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover, .search-result-item.active { background: var(--bg-subtle); }
.rue-nom { font-weight: 600; }
.rue-commune { font-size: 12px; color: var(--text-mid); }

/* ---- Footer ---- */
.site-footer {
  margin-top: 48px; padding: 32px 24px; border-top: 1px solid var(--border);
  text-align: center; font-size: 13px; color: var(--text-light);
}
.site-footer a { color: var(--text-mid); text-decoration: none; }
.site-footer a:hover { color: var(--brand); }
.site-footer-links { display: flex; justify-content: center; gap: 20px; margin-bottom: 12px; }

/* ---- Utilitaire ---- */
.text-brand { color: var(--brand); }
.text-mid { color: var(--text-mid); }
.fw-700 { font-weight: 700; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

/* Métriques live ------------------------------------------- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  margin: 2.5rem 0;
}

.stat-card {
  background: var(--color-surface, #fff);
  border: 0.5px solid var(--color-border, #e0ddd6);
  border-radius: 12px;
  padding: 1.25rem 1rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stat-value {
  font-size: 28px;
  font-weight: 500;
  color: var(--color-accent, #2e7d5e);
  line-height: 1;
  letter-spacing: -0.5px;
}

.stat-label {
  font-size: 12px;
  color: var(--color-text-muted, #888);
  line-height: 1.4;
}

/* Sections génériques -------------------------------------- */
.section {
  margin: 3.5rem 0;
}

.section-alt {
  background: var(--color-surface-subtle, #f8f7f4);
  border-radius: 16px;
  padding: 2.5rem;
  margin-left: -1rem;
  margin-right: -1rem;
}

.section-title {
  font-size: 22px;
  font-weight: 500;
  text-align: center;
  margin-bottom: 2rem;
  color: var(--color-text, #1a1a18);
}

/* Comment ça marche ---------------------------------------- */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

.step-card {
  background: var(--color-surface, #fff);
  border: 0.5px solid var(--color-border, #e0ddd6);
  border-radius: 12px;
  padding: 1.5rem 1.25rem;
}

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--color-accent-light, #e8f5ee);
  color: var(--color-accent, #2e7d5e);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 12px;
}

.step-card h3 {
  font-size: 15px;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--color-text, #1a1a18);
}

.step-card p {
  font-size: 13px;
  color: var(--color-text-muted, #888);
  line-height: 1.6;
}

/* Pourquoi ------------------------------------------------- */
.why-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
}

.why-item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.why-icon {
  font-size: 22px;
  flex-shrink: 0;
  margin-top: 2px;
}

.why-item h3 {
  font-size: 15px;
  font-weight: 500;
  margin-bottom: 4px;
  color: var(--color-text, #1a1a18);
}

.why-item p {
  font-size: 13px;
  color: var(--color-text-muted, #888);
  line-height: 1.6;
}

/* FAQ ------------------------------------------------------ */
.faq-list {
  max-width: 640px;
  margin: 0 auto;
}

.faq-item {
  border-bottom: 0.5px solid var(--color-border, #e0ddd6);
  padding: 1.25rem 0;
}

.faq-item:last-child {
  border-bottom: none;
}

.faq-item dt {
  font-size: 15px;
  font-weight: 500;
  color: var(--color-text, #1a1a18);
  margin-bottom: 6px;
}

.faq-item dd {
  font-size: 13px;
  color: var(--color-text-muted, #888);
  line-height: 1.7;
  margin: 0;
}

/* Footer --------------------------------------------------- */
.site-footer {
  text-align: center;
  padding: 2rem 1rem;
  font-size: 12px;
  color: var(--color-text-muted, #bbb);
  border-top: 0.5px solid var(--color-border, #e0ddd6);
  margin-top: 3rem;
}



/* ---- Bandeau consentement cookies (RGPD) ---- */
#cookie-consent-banner {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 9999;
  background: var(--bg-card); border-top: 1px solid var(--border);
  box-shadow: 0 -8px 30px rgba(0,0,0,0.08);
  padding: 20px 24px; display: none;
}
#cookie-consent-banner.is-visible { display: block; }
.cc-inner { max-width: var(--max-w); margin: 0 auto; display: flex; gap: 24px; align-items: center; flex-wrap: wrap; }
.cc-text { flex: 1 1 380px; font-size: 14px; color: var(--text-mid); line-height: 1.5; }
.cc-text a { color: var(--brand); font-weight: 600; text-decoration: underline; }
.cc-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.cc-btn { border: none; border-radius: 10px; padding: 10px 18px; font-size: 14px; font-weight: 700; cursor: pointer; }
.cc-btn-accept { background: var(--brand); color: #fff; }
.cc-btn-accept:hover { background: var(--brand-dark); }
.cc-btn-reject { background: var(--bg-subtle); color: var(--text-dark); border: 1px solid var(--border-strong); }
.cc-btn-reject:hover { background: var(--border); }
.cc-btn-settings { background: transparent; color: var(--text-mid); text-decoration: underline; padding: 10px 4px; }

#cookie-settings-modal { position: fixed; inset: 0; z-index: 10000; display: none; align-items: center; justify-content: center; background: rgba(11,26,51,0.5); padding: 16px; }
#cookie-settings-modal.is-visible { display: flex; }
.cc-modal-box { background: var(--bg-card); border-radius: var(--radius); max-width: 520px; width: 100%; padding: 28px; box-shadow: var(--shadow-hover); max-height: 85vh; overflow-y: auto; }
.cc-modal-box h2 { font-size: 19px; margin: 0 0 12px; color: var(--text-dark); }
.cc-modal-box p { font-size: 14px; color: var(--text-mid); line-height: 1.5; margin: 0 0 16px; }
.cc-purpose { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 14px 0; border-top: 1px solid var(--border); }
.cc-purpose h3 { font-size: 14px; margin: 0 0 4px; color: var(--text-dark); }
.cc-purpose p { font-size: 13px; margin: 0; color: var(--text-light); }
.cc-switch { position: relative; width: 42px; height: 24px; flex: 0 0 auto; }
.cc-switch input { opacity: 0; width: 0; height: 0; }
.cc-switch-track { position: absolute; inset: 0; background: var(--border-strong); border-radius: 999px; cursor: pointer; transition: background .15s; }
.cc-switch-track::before { content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: transform .15s; }
.cc-switch input:checked + .cc-switch-track { background: var(--brand); }
.cc-switch input:checked + .cc-switch-track::before { transform: translateX(18px); }
.cc-switch input:disabled + .cc-switch-track { background: var(--brand-light); cursor: not-allowed; opacity: .7; }
.cc-modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.cc-footer-link-btn { background: none; border: none; padding: 0; color: inherit; text-decoration: underline; cursor: pointer; font: inherit; }
