/* ================================================
   Je Rachète Votre Automobile – Landing Page CSS
   ================================================ */

/* ---- Variables ---- */
:root {
  --blue:       #4949f4;
  --blue-dark:  #3333cc;
  --blue-light: #e8e8ff;
  --dark:       #1a1a2e;
  --gray:       #555;
  --light-gray: #f5f5f5;
  --border:     #e0e0e0;
  --white:      #ffffff;
  --radius:     6px;
  --shadow:     0 2px 16px rgba(73,73,244,0.10);
  --font:       'Segoe UI', Arial, sans-serif;
}

/* ---- Reset & base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font);
  color: var(--dark);
  background: var(--white);
  line-height: 1.6;
  touch-action: pan-x pan-y;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
/* Liens dans le corps de texte : soulignés pour accessibilité WCAG */
p a, li a { text-decoration: underline; }
p a:hover, li a:hover { opacity: .8; }
ul { list-style: none; }

/* ---- Container ---- */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---- Sections ---- */
.section-light { background: var(--white); padding: 64px 0; }
.section-blue  { background: var(--blue-light); padding: 64px 0; }
.section-dark  { background: var(--dark); color: var(--white); padding: 64px 0; }

h2 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 12px;
  text-align: center;
}
.section-dark h2 { color: var(--white); }
.section-intro {
  text-align: center;
  color: var(--gray);
  margin-bottom: 40px;
  font-size: 1.05rem;
}
.section-dark .section-intro { color: #ccc; }

/* ---- Buttons ---- */
.btn-primary {
  display: inline-block;
  background: var(--blue);
  color: var(--white) !important;
  font-weight: 700;
  font-size: 1rem;
  padding: 14px 32px;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: background .2s, transform .1s;
  text-decoration: none !important;
  letter-spacing: .5px;
}
.btn-primary:hover { background: var(--blue-dark); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }
.btn-submit { width: 100%; font-size: 1.1rem; padding: 16px; margin-top: 8px; }

/* ---- Header ---- */
#header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--white);
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.logo img { width: 42px; height: 42px; object-fit: contain; }
.logo-text {
  font-weight: 700;
  color: var(--blue);
  font-size: .95rem;
  white-space: nowrap;
}
#navMenu ul {
  display: flex;
  gap: 24px;
  align-items: center;
}
#navMenu a {
  color: var(--dark);
  font-size: .9rem;
  font-weight: 500;
  white-space: nowrap;
}
#navMenu a:hover { color: var(--blue); text-decoration: none; }
.nav-cta {
  background: var(--blue);
  color: var(--white) !important;
  padding: 8px 16px;
  border-radius: var(--radius);
}
.nav-cta:hover { background: var(--blue-dark) !important; }
.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--dark);
  transition: all .2s;
}

/* ---- Hero ---- */
#hero {
  position: relative;
  min-height: 480px;
  display: flex;
  align-items: center;
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
.hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(73,73,244,.82) 0%, rgba(26,26,46,.72) 100%);
}
.hero-content {
  position: relative;
  z-index: 1;
  color: var(--white);
  max-width: 680px;
  padding: 60px 20px;
}
.hero-content h1 {
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 16px;
  text-shadow: 0 2px 8px rgba(0,0,0,.3);
  text-align: left;
}
.hero-sub {
  font-size: 1.1rem;
  margin-bottom: 32px;
  opacity: .92;
}

/* ---- Steps ---- */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  margin-top: 40px;
}
.step {
  background: var(--light-gray);
  border-radius: var(--radius);
  padding: 28px 24px;
  text-align: center;
  border-top: 4px solid var(--blue);
}
.step-num {
  width: 48px;
  height: 48px;
  background: var(--blue);
  color: var(--white);
  font-weight: 800;
  font-size: 1.4rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}
.step h3 { font-size: 1.05rem; margin-bottom: 8px; }
.step p  { font-size: .9rem; color: var(--gray); }

/* ---- Avantages ---- */
.avantages-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 40px;
}
.avantage {
  background: var(--white);
  border-radius: var(--radius);
  padding: 24px 20px;
  box-shadow: var(--shadow);
  text-align: center;
}
.avantage-icon { font-size: 2rem; margin-bottom: 12px; }
.avantage h3 { font-size: 1rem; margin-bottom: 8px; font-weight: 700; }
.avantage p  { font-size: .88rem; color: var(--gray); }

/* ---- Formulaire ---- */
#estimation { background: var(--light-gray); }
form fieldset {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
  background: var(--white);
}
form legend {
  font-weight: 700;
  font-size: 1rem;
  color: var(--blue);
  padding: 0 8px;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.form-group {
  display: flex;
  flex-direction: column;
  margin-bottom: 16px;
}
.form-group:last-child { margin-bottom: 0; }
label {
  font-weight: 600;
  font-size: .88rem;
  margin-bottom: 6px;
  color: var(--dark);
}
label span { color: var(--blue); }
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: .95rem;
  color: var(--dark);
  background: var(--white);
  transition: border-color .2s, box-shadow .2s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(73,73,244,.15);
}
textarea { resize: vertical; min-height: 100px; }
.form-legal { margin-bottom: 20px; }
.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: .88rem;
  font-weight: 400;
  cursor: pointer;
}
.checkbox-label input { margin-top: 3px; flex-shrink: 0; }
/* Honeypot */
.hp-field { display: none !important; }
/* Messages */
#formMessage {
  margin-bottom: 12px;
  padding: 12px 16px;
  border-radius: var(--radius);
  font-weight: 600;
  display: none;
}
#formMessage.success { background: #e6f9f0; color: #1a7a4a; border: 1px solid #8ed4b0; display: block; }
#formMessage.error   { background: #fdecea; color: #c0392b; border: 1px solid #f4a4a4; display: block; }
.spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 3px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  vertical-align: middle;
  margin-left: 8px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Modale confirmation ---- */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-overlay.open {
  display: flex;
}
.modal-box {
  background: var(--white);
  border-radius: 12px;
  padding: 40px 32px 32px;
  max-width: 440px;
  width: 100%;
  text-align: center;
  box-shadow: 0 8px 40px rgba(0,0,0,.22);
  animation: modalIn .22s ease;
}
@keyframes modalIn {
  from { transform: scale(.92); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}
.modal-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  line-height: 1;
}
.modal-box h3 {
  font-size: 1.25rem;
  margin-bottom: 10px;
  text-align: center;
}
.modal-box p {
  font-size: .95rem;
  color: var(--gray);
  margin-bottom: 28px;
  line-height: 1.6;
}
.modal-close {
  min-width: 140px;
}
.modal-overlay.success .modal-box { border-top: 5px solid #1a7a4a; }
.modal-overlay.error   .modal-box { border-top: 5px solid #c0392b; }
.modal-overlay.success .modal-close { background: #1a7a4a; }
.modal-overlay.success .modal-close:hover { background: #145e38; }
.modal-overlay.error   .modal-close { background: #c0392b; }
.modal-overlay.error   .modal-close:hover { background: #922b21; }
@media (max-width: 600px) {
  .modal-box { padding: 28px 20px 24px; }
}

/* ---- Pourquoi pro ---- */
.pro-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 48px;
  align-items: start;
  margin-top: 40px;
}
.pro-block img {
  border-radius: var(--radius);
  width: 100%;
  object-fit: cover;
}
.pro-text p { margin-bottom: 16px; opacity: .92; }
.pro-liste {
  margin: 16px 0 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pro-liste li::before { content: "✓ "; color: #4fc97e; font-weight: 700; }
.pro-liste li { opacity: .92; }
blockquote {
  border-left: 4px solid var(--blue);
  padding: 12px 20px;
  background: rgba(255,255,255,.07);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-style: italic;
  margin: 0 0 24px;
  opacity: .9;
}

/* ---- Zones ---- */
.zones-grid {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 48px;
  align-items: start;
  margin-top: 40px;
}
.zones-carte img {
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  width: 100%;
}
.zones-text h3 { font-size: 1.1rem; margin-bottom: 16px; }
.zones-liste {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}
.zones-liste li::before { content: "📍 "; }

/* ---- Qui sommes-nous ---- */
.qui-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 48px;
  align-items: start;
  margin-top: 40px;
}
.qui-img img {
  border-radius: var(--radius);
  width: 100%;
  object-fit: cover;
}
.qui-text p { margin-bottom: 16px; }
.qui-infos {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 24px;
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}
.info-item { display: flex; flex-direction: column; gap: 2px; }
.info-item strong { font-size: .85rem; color: var(--blue); text-transform: uppercase; letter-spacing: .5px; }
.info-item span { font-size: .95rem; }

/* ---- Photo upload ---- */
.photos-hint-p {
  font-size: .88rem;
  color: var(--gray);
  margin-bottom: 14px;
}
.optional { font-weight: 400; font-size: .85rem; color: var(--gray); }
.photos-drop {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  background: var(--light-gray);
  transition: border-color .2s, background .2s;
  cursor: pointer;
}
.photos-drop:hover, .photos-drop.drag-over {
  border-color: var(--blue);
  background: var(--blue-light);
}
#photosInput { display: none; }
.photos-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 28px 16px;
  cursor: pointer;
  gap: 6px;
}
.photos-icon      { font-size: 2rem; }
.photos-label-text{ font-weight: 600; color: var(--dark); }
.photos-label-sub { font-size: .8rem; color: var(--gray); }
.photos-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
}
.photo-thumb {
  position: relative;
  width: 100px;
  flex-shrink: 0;
}
.photo-thumb img {
  width: 100px;
  height: 80px;
  object-fit: cover;
  border-radius: 4px;
  display: block;
  border: 1px solid var(--border);
}
.photo-thumb .photo-size {
  font-size: .72rem;
  color: var(--gray);
  text-align: center;
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.photo-thumb .photo-remove {
  position: absolute;
  top: 3px;
  right: 3px;
  background: rgba(0,0,0,.6);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font-size: .75rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 0;
}
.photo-thumb .photo-remove:hover { background: #c0392b; }
.photo-thumb .photo-compressing {
  position: absolute;
  inset: 0 0 20px;
  background: rgba(255,255,255,.75);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .7rem;
  border-radius: 4px;
}
.photos-info {
  margin-top: 10px;
  font-size: .82rem;
  color: var(--gray);
}
.photos-info.warn { color: #c0392b; font-weight: 600; }
@media (max-width: 600px) {
  .photo-thumb { width: 80px; }
  .photo-thumb img { width: 80px; height: 64px; }
}

/* ---- Footer ---- */
/* Couleurs solides (pas de rgba) pour garantir contraste WCAG AA sur #3a506b */
#footer {
  background: #3a506b;
  color: #ffffff;
  padding: 40px 0 24px;
}
.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  text-align: center;
}
.footer-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}
.footer-logo img { width: 40px; height: 40px; object-fit: contain; }
.footer-logo span { font-weight: 700; color: #ffffff; font-size: 1rem; }
.footer-nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 24px; }
.footer-nav a { color: #e8edf2; font-size: .9rem; text-decoration: underline; }
.footer-nav a:hover { color: #ffffff; }
.footer-legal { font-size: .8rem; color: #c8d5e0; }   /* ratio 4.97:1 ✅ WCAG AA */
.footer-credit { font-size: .8rem; color: #c5d3de; }  /* ratio 4.89:1 ✅ WCAG AA */
.footer-credit a { color: #c8d5e0; text-decoration: underline; }

/* ---- Back to top ---- */
.back-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--blue);
  color: var(--white);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(73,73,244,.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
  text-decoration: none !important;
  z-index: 999;
}
.back-to-top.visible { opacity: 1; pointer-events: auto; }

/* ================================================
   RESPONSIVE
   ================================================ */

/* Tablette ≤ 900px */
@media (max-width: 900px) {
  h2 { font-size: 1.6rem; }
  .steps-grid    { grid-template-columns: 1fr; max-width: 500px; margin-left: auto; margin-right: auto; }
  .avantages-grid { grid-template-columns: repeat(2, 1fr); }
  .pro-grid      { grid-template-columns: 1fr; }
  .pro-block     { max-width: 320px; margin: 0 auto; }
  .zones-grid    { grid-template-columns: 1fr; }
  .qui-grid      { grid-template-columns: 1fr; }
  .qui-img       { max-width: 320px; margin: 0 auto; }
}

/* Mobile ≤ 600px */
@media (max-width: 600px) {
  .section-light, .section-blue, .section-dark { padding: 40px 0; }
  h2 { font-size: 1.35rem; }
  .hero-content h1 { font-size: 1.4rem; }
  .hero-sub        { font-size: .95rem; }
  .hero-content    { padding: 40px 16px; }
  #hero            { min-height: 360px; }
  .avantages-grid  { grid-template-columns: 1fr; }
  .form-row        { grid-template-columns: 1fr; }

  /* Menu burger */
  .menu-toggle { display: flex; }
  #navMenu {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--white);
    box-shadow: 0 4px 16px rgba(0,0,0,.12);
    z-index: 999;
  }
  #navMenu.open { display: block; }
  #navMenu ul {
    flex-direction: column;
    gap: 0;
    padding: 8px 0;
  }
  #navMenu li { width: 100%; }
  #navMenu a {
    display: block;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border);
  }
  .nav-cta { margin: 8px 20px; border-radius: var(--radius); text-align: center; }

  .logo-text { font-size: .8rem; }
  .footer-nav { gap: 8px 16px; }
  .back-to-top { bottom: 16px; right: 16px; }
}
