/* ============================================
   ARDI - Diagnostic Immobilier Rouen
   Style principal — Mobile-first
   ============================================ */

/* --- Reset & Base --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

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

:root {
  --blue: #1e3a5f;
  --blue-light: #2a4f7f;
  --blue-dark: #132840;
  --green: #10b981;
  --green-light: #34d399;
  --green-dark: #059669;
  --white: #ffffff;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
  --shadow-md: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);
  --shadow-lg: 0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --transition: 0.3s ease;
}

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--gray-800);
  background: var(--white);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: var(--blue); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--green); }
ul, ol { padding-left: 1.25em; }
p { margin-bottom: 1em; }

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
  color: var(--blue);
  line-height: 1.25;
  margin-bottom: 0.75em;
  font-weight: 700;
}
h1 { font-size: clamp(1.75rem, 4vw, 2.75rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.25rem); }
h3 { font-size: clamp(1.15rem, 2.5vw, 1.5rem); }
h4 { font-size: 1.15rem; }

/* --- Container --- */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* --- Header --- */
.header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--white);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition);
}
.header.scrolled { box-shadow: var(--shadow-md); }

.header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

.logo {
  font-size: 1.75rem;
  font-weight: 900;
  color: var(--blue);
  letter-spacing: 2px;
  text-transform: uppercase;
}
.logo span { color: var(--green); }

/* Nav desktop */
.nav { display: flex; align-items: center; gap: 0.25rem; }
.nav a {
  padding: 0.5rem 0.85rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--gray-700);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  white-space: nowrap;
}
.nav a:hover, .nav a.active { color: var(--blue); background: var(--gray-100); }
.nav .btn-nav {
  background: var(--green);
  color: var(--white);
  padding: 0.5rem 1.25rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
}
.nav .btn-nav:hover { background: var(--green-dark); color: var(--white); }

/* Burger */
.burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 4px;
  background: none;
  border: none;
}
.burger span {
  width: 26px;
  height: 3px;
  background: var(--blue);
  border-radius: 3px;
  transition: all var(--transition);
}
.burger.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 6px); }
.burger.open span:nth-child(2) { opacity: 0; }
.burger.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -6px); }

/* Mobile nav */
.nav-mobile {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--white);
  box-shadow: var(--shadow-lg);
  padding: 1rem;
  flex-direction: column;
  gap: 0.25rem;
}
.nav-mobile.open { display: flex; }
.nav-mobile a {
  padding: 0.75rem 1rem;
  color: var(--gray-700);
  font-weight: 500;
  border-radius: var(--radius-sm);
}
.nav-mobile a:hover { background: var(--gray-100); color: var(--blue); }

@media (max-width: 900px) {
  .nav { display: none; }
  .burger { display: flex; }
}

/* --- Hero --- */
.hero {
  background: linear-gradient(135deg, var(--blue-dark) 0%, var(--blue) 50%, var(--blue-light) 100%);
  color: var(--white);
  padding: 4rem 0 3.5rem;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(16,185,129,0.15) 0%, transparent 70%);
  border-radius: 50%;
}
.hero-content { position: relative; z-index: 1; max-width: 720px; }
.hero h1 { color: var(--white); font-size: clamp(1.75rem, 4.5vw, 3rem); margin-bottom: 1rem; }
.hero p { font-size: clamp(1rem, 2vw, 1.2rem); color: rgba(255,255,255,0.9); margin-bottom: 2rem; line-height: 1.6; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 1rem; }

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.75rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  text-align: center;
  line-height: 1.4;
}
.btn-primary { background: var(--green); color: var(--white); }
.btn-primary:hover { background: var(--green-dark); color: var(--white); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn-secondary { background: rgba(255,255,255,0.15); color: var(--white); border: 2px solid rgba(255,255,255,0.4); }
.btn-secondary:hover { background: rgba(255,255,255,0.25); color: var(--white); transform: translateY(-2px); }
.btn-outline { background: transparent; color: var(--blue); border: 2px solid var(--blue); }
.btn-outline:hover { background: var(--blue); color: var(--white); transform: translateY(-2px); }

/* --- Sections --- */
.section { padding: 4rem 0; }
.section-gray { background: var(--gray-50); }
.section-blue { background: var(--blue); color: var(--white); }
.section-blue h2, .section-blue h3 { color: var(--white); }

.section-header { text-align: center; max-width: 700px; margin: 0 auto 3rem; }
.section-header p { color: var(--gray-500); font-size: 1.05rem; }
.section-blue .section-header p { color: rgba(255,255,255,0.8); }

.badge {
  display: inline-block;
  background: rgba(16,185,129,0.1);
  color: var(--green);
  padding: 0.35rem 1rem;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.section-blue .badge { background: rgba(16,185,129,0.2); }

/* --- Grid --- */
.grid-2 { display: grid; grid-template-columns: 1fr; gap: 2rem; }
.grid-3 { display: grid; grid-template-columns: 1fr; gap: 2rem; }
.grid-4 { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }
@media (min-width: 640px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 900px) {
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
}

/* --- Cards --- */
.card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
  transition: all var(--transition);
  border: 1px solid var(--gray-200);
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.card-icon {
  width: 56px;
  height: 56px;
  background: rgba(16,185,129,0.1);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
}
.card-icon svg { width: 28px; height: 28px; color: var(--green); stroke: var(--green); fill: none; }
.card h3 { font-size: 1.15rem; margin-bottom: 0.5rem; }
.card p { color: var(--gray-600); font-size: 0.95rem; margin-bottom: 0.75rem; }
.card-link {
  color: var(--green);
  font-weight: 600;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.card-link:hover { color: var(--green-dark); gap: 0.6rem; }

/* --- Steps --- */
.steps { display: flex; flex-direction: column; gap: 2rem; counter-reset: step; }
@media (min-width: 768px) { .steps { flex-direction: row; } }
.step {
  flex: 1;
  text-align: center;
  padding: 2rem;
  position: relative;
  counter-increment: step;
}
.step-number {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--green);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 800;
  margin: 0 auto 1.25rem;
}
.step h3 { font-size: 1.15rem; }
.step p { color: var(--gray-500); font-size: 0.95rem; }

/* --- FAQ --- */
.faq-list { max-width: 800px; margin: 0 auto; }
.faq-item {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  margin-bottom: 0.75rem;
  overflow: hidden;
  background: var(--white);
}
.faq-question {
  width: 100%;
  padding: 1.15rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  background: none;
  border: none;
  font-size: 1rem;
  font-weight: 600;
  color: var(--gray-800);
  text-align: left;
  font-family: inherit;
  gap: 1rem;
}
.faq-question:hover { color: var(--blue); }
.faq-question svg { width: 20px; height: 20px; flex-shrink: 0; transition: transform var(--transition); stroke: var(--gray-400); }
.faq-item.open .faq-question svg { transform: rotate(180deg); stroke: var(--green); }
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, padding 0.4s ease;
}
.faq-item.open .faq-answer { max-height: 600px; }
.faq-answer-inner { padding: 0 1.5rem 1.25rem; color: var(--gray-600); line-height: 1.7; }

/* --- Testimonials --- */
.testimonial {
  background: var(--white);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--gray-200);
}
.testimonial-stars { color: #f59e0b; font-size: 1.1rem; margin-bottom: 0.75rem; letter-spacing: 2px; }
.testimonial p { font-style: italic; color: var(--gray-600); margin-bottom: 1rem; font-size: 0.95rem; }
.testimonial-author { font-weight: 600; color: var(--gray-800); font-size: 0.9rem; }
.testimonial-author span { color: var(--gray-400); font-weight: 400; }

/* --- Map --- */
.map-container {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  height: 400px;
}
.map-container iframe { width: 100%; height: 100%; border: 0; }

/* --- Zone list --- */
.zone-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  padding: 0;
}
.zone-list li {
  background: var(--gray-100);
  padding: 0.4rem 1rem;
  border-radius: 50px;
  font-size: 0.9rem;
  color: var(--gray-700);
  font-weight: 500;
}

/* --- Advantages --- */
.advantage {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}
.advantage-icon {
  width: 48px;
  height: 48px;
  min-width: 48px;
  background: rgba(16,185,129,0.1);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}
.advantage-icon svg { width: 24px; height: 24px; stroke: var(--green); fill: none; }
.advantage h4 { margin-bottom: 0.25rem; }
.advantage p { color: var(--gray-500); font-size: 0.9rem; margin-bottom: 0; }

/* --- CTA Banner --- */
.cta-banner {
  background: linear-gradient(135deg, var(--blue-dark), var(--blue));
  border-radius: var(--radius-lg);
  padding: 3rem 2rem;
  text-align: center;
  color: var(--white);
}
.cta-banner h2 { color: var(--white); margin-bottom: 0.75rem; }
.cta-banner p { color: rgba(255,255,255,0.85); margin-bottom: 1.5rem; font-size: 1.05rem; }

/* --- Tables --- */
.table-responsive { overflow-x: auto; margin: 1.5rem 0; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
th, td {
  padding: 0.85rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--gray-200);
}
th {
  background: var(--blue);
  color: var(--white);
  font-weight: 600;
  white-space: nowrap;
}
tr:hover { background: var(--gray-50); }

/* DPE classes */
.dpe-table td:first-child { font-weight: 700; color: var(--white); text-align: center; border-radius: 4px; }
.dpe-a { background: #319834 !important; }
.dpe-b { background: #33cc31 !important; }
.dpe-c { background: #cbfc34 !important; color: var(--gray-800) !important; }
.dpe-d { background: #fbfe06 !important; color: var(--gray-800) !important; }
.dpe-e { background: #fccc04 !important; color: var(--gray-800) !important; }
.dpe-f { background: #fc9935 !important; }
.dpe-g { background: #fc1b1c !important; }

/* --- DPE Tool --- */
.dpe-tool {
  background: var(--white);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow-md);
  border: 2px solid var(--green);
  max-width: 600px;
  margin: 2rem auto;
}
.dpe-tool h3 { text-align: center; margin-bottom: 1.5rem; }
.form-group { margin-bottom: 1.25rem; }
.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--gray-700);
  font-size: 0.9rem;
}
.form-group select, .form-group input[type="number"], .form-group input[type="text"],
.form-group input[type="email"], .form-group input[type="tel"], .form-group textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color var(--transition);
  background: var(--white);
}
.form-group select:focus, .form-group input:focus, .form-group textarea:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(16,185,129,0.15);
}
.dpe-result {
  text-align: center;
  padding: 1.5rem;
  border-radius: var(--radius-sm);
  margin-top: 1.5rem;
  display: none;
}
.dpe-result.show { display: block; }
.dpe-result .class-letter {
  font-size: 4rem;
  font-weight: 900;
  display: block;
  margin-bottom: 0.5rem;
}

/* --- Contact Form --- */
.contact-form {
  background: var(--white);
  border-radius: var(--radius);
  padding: 2.5rem;
  box-shadow: var(--shadow-md);
}
.form-row { display: grid; grid-template-columns: 1fr; gap: 1.25rem; }
@media (min-width: 640px) { .form-row { grid-template-columns: 1fr 1fr; } }
.checkbox-group { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.checkbox-group label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 400;
  cursor: pointer;
  font-size: 0.9rem;
}
.checkbox-group input { accent-color: var(--green); width: 18px; height: 18px; }
.form-group textarea { min-height: 120px; resize: vertical; }

/* --- Footer --- */
.footer {
  background: var(--gray-900);
  color: var(--gray-400);
  padding: 3.5rem 0 0;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--gray-700);
}
@media (min-width: 640px) { .footer-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; } }

.footer h4 { color: var(--white); font-size: 1rem; margin-bottom: 1rem; }
.footer p { font-size: 0.9rem; line-height: 1.7; }
.footer ul { list-style: none; padding: 0; }
.footer ul li { margin-bottom: 0.5rem; }
.footer ul a { color: var(--gray-400); font-size: 0.9rem; }
.footer ul a:hover { color: var(--green); }
.footer-bottom {
  padding: 1.5rem 0;
  text-align: center;
  font-size: 0.85rem;
  color: var(--gray-500);
}
.footer .logo { color: var(--white); }

/* --- Breadcrumb --- */
.breadcrumb {
  padding: 1rem 0;
  font-size: 0.85rem;
  color: var(--gray-400);
}
.breadcrumb a { color: var(--gray-500); }
.breadcrumb a:hover { color: var(--green); }
.breadcrumb span { margin: 0 0.4rem; }

/* --- Page Hero (sub-pages) --- */
.page-hero {
  background: linear-gradient(135deg, var(--blue-dark), var(--blue));
  color: var(--white);
  padding: 3rem 0 2.5rem;
}
.page-hero h1 { color: var(--white); margin-bottom: 0.5rem; }
.page-hero p { color: rgba(255,255,255,0.85); font-size: 1.05rem; max-width: 650px; }

/* --- Content --- */
.content { padding: 3rem 0; }
.content h2 { margin-top: 2rem; }
.content h3 { margin-top: 1.5rem; }
.content ul, .content ol { margin-bottom: 1rem; }
.content li { margin-bottom: 0.35rem; }

.content-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
}
@media (min-width: 900px) {
  .content-grid { grid-template-columns: 2fr 1fr; }
}

/* Sidebar */
.sidebar-card {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  position: sticky;
  top: 80px;
}
.sidebar-card h4 { margin-bottom: 0.75rem; }
.sidebar-card ul { list-style: none; padding: 0; }
.sidebar-card li { margin-bottom: 0.5rem; }
.sidebar-card a { font-size: 0.9rem; font-weight: 500; }

/* --- Info box --- */
.info-box {
  background: rgba(16,185,129,0.08);
  border-left: 4px solid var(--green);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
}
.info-box strong { color: var(--blue); }
.info-box p:last-child { margin-bottom: 0; }

.warning-box {
  background: rgba(245,158,11,0.08);
  border-left: 4px solid #f59e0b;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
}

/* --- Animations --- */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.fade-in.visible { opacity: 1; transform: translateY(0); }
.fade-in-left {
  opacity: 0;
  transform: translateX(-30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.fade-in-left.visible { opacity: 1; transform: translateX(0); }

/* --- Phone bar --- */
.topbar {
  background: var(--blue-dark);
  color: rgba(255,255,255,0.8);
  font-size: 0.8rem;
  padding: 0.4rem 0;
}
.topbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.topbar a { color: var(--green-light); font-weight: 600; }
.topbar a:hover { color: var(--white); }

/* --- Back to top --- */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 48px;
  height: 48px;
  background: var(--green);
  color: var(--white);
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition);
  box-shadow: var(--shadow-md);
  z-index: 999;
}
.back-to-top.show { opacity: 1; visibility: visible; }
.back-to-top:hover { background: var(--green-dark); transform: translateY(-3px); }
.back-to-top svg { width: 24px; height: 24px; }

/* --- Misc --- */
.text-center { text-align: center; }
.text-green { color: var(--green); }
.text-blue { color: var(--blue); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

/* Stars SVG */
.stars svg { width: 18px; height: 18px; fill: #f59e0b; display: inline; vertical-align: middle; }

/* --- Print --- */
@media print {
  .header, .footer, .back-to-top, .topbar { display: none; }
  .hero, .page-hero { background: var(--gray-100) !important; color: var(--gray-900) !important; }
}
