/* ==========================================================
   La Marillaisienne · feuille de style
   Palette « Esprit Loire » : bleu Loire, blanc tuffeau, ocre
   ========================================================== */

@font-face {
  font-family: "Fraunces";
  src: url("/fonts/fraunces-latin-wght-normal.woff2") format("woff2");
  font-weight: 300 900; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Fraunces";
  src: url("/fonts/fraunces-latin-wght-italic.woff2") format("woff2");
  font-weight: 300 900; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("/fonts/inter-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap;
}

:root {
  --loire: #123e57;
  --loire-deep: #0b2a3c;
  --loire-soft: #dbe7ee;
  --tuffeau: #f5f0e6;
  --tuffeau-2: #ece4d4;
  --paper: #fbf8f2;
  --ocre: #e3a857;
  --ocre-text: #8a5a14;   /* ocre lisible sur fond clair (contraste AA) */
  --ink: #1b2a33;
  --muted: #4d5d67;
  --line: #d9cfbd;
  --danger: #a3261b;
  --ok: #1f6b45;

  --radius: 14px;
  --shadow: 0 1px 2px rgba(11,42,60,.06), 0 8px 24px rgba(11,42,60,.08);
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--tuffeau);
}
img, svg { display: block; max-width: 100%; }
a { color: var(--loire); text-underline-offset: 3px; }
a:hover { color: var(--loire-deep); }
:focus-visible { outline: 3px solid var(--ocre); outline-offset: 3px; border-radius: 4px; }

h1, h2, h3 { font-family: var(--serif); color: var(--loire-deep); line-height: 1.15; margin: 0 0 .5em; font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: clamp(2.1rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1em; }

.wrap { width: min(1140px, 100% - 32px); margin-inline: auto; }
.narrow { width: min(780px, 100% - 32px); }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  background: var(--loire-deep); color: #fff; padding: 10px 16px; border-radius: 8px;
}
.skip-link:focus { top: 12px; color: #fff; }

/* Repère visuel des infos à compléter (à retirer une fois rempli) */
.todo { background: rgba(227,168,87,.22); outline: 1px dashed var(--ocre-text); border-radius: 3px; padding: 0 .2em; }

.eyebrow {
  font-size: .8rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ocre-text); margin-bottom: .8em;
  display: inline-flex; align-items: center; gap: .6em;
}
.eyebrow::before {
  content: ""; width: 26px; height: 8px; flex: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 26 8'%3E%3Cpath d='M1 5c3-3 5-3 8 0s5 3 8 0 5-3 8 0' fill='none' stroke='%23e3a857' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat center/contain;
}
.small { font-size: .9rem; }
.muted { color: var(--muted); }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 48px; padding: .75em 1.4em;
  font: 600 1rem/1.2 var(--sans);
  color: #fff; background: var(--loire);
  border: 2px solid var(--loire); border-radius: 999px;
  text-decoration: none; cursor: pointer;
  transition: background .2s, color .2s, transform .2s, box-shadow .2s;
}
.btn:hover { background: var(--loire-deep); border-color: var(--loire-deep); color: #fff; transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-ghost { background: transparent; color: var(--loire); }
.btn-ghost:hover { background: var(--loire); color: #fff; }
.btn-small { min-height: 42px; padding: .5em 1.1em; font-size: .95rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .6; cursor: wait; transform: none; }
.icon { width: 18px; height: 18px; flex: none; }

/* ---------- En-tête ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(245,240,230,.92);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.site-header.is-scrolled { border-bottom-color: var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 72px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--loire); }
.brand-mark { width: 44px; height: 44px; flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font-family: var(--serif); font-weight: 650; font-size: 1.25rem; color: var(--loire-deep); }
.brand-tag { font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-top: 3px; }

.nav ul { display: flex; align-items: center; gap: 4px; list-style: none; margin: 0; padding: 0; }
.nav a:not(.btn) {
  display: block; padding: .55em .8em; border-radius: 8px;
  color: var(--ink); font-weight: 500; text-decoration: none;
}
.nav a:not(.btn):hover { background: var(--tuffeau-2); color: var(--loire-deep); }
.nav li:last-child { margin-left: 8px; }

.nav-toggle { display: none; }

@media (max-width: 880px) {
  .nav-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 48px; height: 48px; border: 1px solid var(--line); border-radius: 12px;
    background: var(--paper); cursor: pointer;
  }
  .nav-toggle-bars, .nav-toggle-bars::before, .nav-toggle-bars::after {
    display: block; width: 20px; height: 2px; background: var(--loire-deep); border-radius: 2px;
    position: relative; transition: transform .2s, background .2s;
  }
  .nav-toggle-bars::before, .nav-toggle-bars::after { content: ""; position: absolute; left: 0; }
  .nav-toggle-bars::before { top: -6px; }
  .nav-toggle-bars::after { top: 6px; }
  .nav-toggle[aria-expanded="true"] .nav-toggle-bars { background: transparent; }
  .nav-toggle[aria-expanded="true"] .nav-toggle-bars::before { transform: translateY(6px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] .nav-toggle-bars::after { transform: translateY(-6px) rotate(-45deg); }

  .nav {
    position: absolute; left: 0; right: 0; top: 100%;
    background: var(--tuffeau); border-bottom: 1px solid var(--line);
    box-shadow: 0 12px 24px rgba(11,42,60,.08);
    display: none;
  }
  .nav.is-open { display: block; }
  .nav ul { flex-direction: column; align-items: stretch; padding: 8px 16px 20px; gap: 2px; }
  .nav a:not(.btn) { padding: .8em .6em; }
  .nav li:last-child { margin: 10px 0 0; }
  .nav .btn { width: 100%; }
  .brand-tag { display: none; }
}

/* ---------- Hero ---------- */
.hero { position: relative; padding: clamp(40px, 7vw, 88px) 0 0; }
.hero-inner { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(24px, 5vw, 64px); align-items: center; padding-bottom: clamp(48px, 7vw, 80px); }
.hero h1 em { font-style: italic; font-weight: 500; color: var(--loire); }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 34em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.hero-art { margin: 0; }
.hero-art svg { width: 100%; height: auto; border-radius: 28px 28px 120px 28px; box-shadow: var(--shadow); }
.divider { display: block; width: 100%; height: 40px; color: var(--paper); }

.wave { animation: drift 7s ease-in-out infinite alternate; }
.w2 { animation-duration: 9s; animation-direction: alternate-reverse; }
.w3 { animation-duration: 11s; }
@keyframes drift { from { transform: translateX(-14px); } to { transform: translateX(14px); } }
.sp { transform-box: fill-box; transform-origin: center; animation: twinkle 3.2s ease-in-out infinite; }
.sp2 { animation-delay: 1.1s; }
.sp3 { animation-delay: 2s; }
@keyframes twinkle { 0%, 100% { opacity: .2; transform: scale(.6); } 50% { opacity: 1; transform: scale(1); } }

@media (max-width: 880px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-art { max-width: 460px; }
}

/* ---------- Engagements ---------- */
.pledges { background: var(--paper); padding: 8px 0 24px; }
.pledges-list {
  list-style: none; margin: 0 auto; padding: 0;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 0;
}
.pledges-list li { padding: 14px 20px; border-left: 2px solid var(--tuffeau-2); display: flex; flex-direction: column; }
.pledges-list li:first-child { border-left-color: transparent; padding-left: 0; }
.pledges-list strong { color: var(--loire-deep); }
.pledges-list span { color: var(--muted); font-size: .92rem; }
@media (max-width: 880px) {
  .pledges-list { grid-template-columns: 1fr 1fr; }
  .pledges-list li, .pledges-list li:first-child { border-left: 2px solid var(--tuffeau-2); padding: 12px 14px; }
}
@media (max-width: 460px) { .pledges-list { grid-template-columns: 1fr; } }

/* ---------- Sections ---------- */
.section { padding: clamp(56px, 9vw, 104px) 0; background: var(--paper); }
.section-alt { background: var(--tuffeau); }
.section-intro { color: var(--muted); max-width: 44em; margin-bottom: 32px; }
.section-dark { background: var(--loire-deep); color: #e7eef2; }
.section-dark h2 { color: #fff; }
.section-dark .eyebrow { color: var(--ocre); }
.section-dark a { color: var(--ocre); }

/* Cartes services */
.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 32px; }
.card {
  background: var(--tuffeau); border: 1px solid var(--tuffeau-2); border-radius: var(--radius);
  padding: clamp(24px, 3vw, 36px); position: relative; overflow: hidden;
}
.card::after {
  content: ""; position: absolute; right: -40px; bottom: -40px; width: 160px; height: 160px;
  border-radius: 50%; background: radial-gradient(circle, rgba(227,168,87,.16), transparent 70%);
}
.card-icon {
  width: 56px; height: 56px; border-radius: 14px; display: grid; place-items: center;
  background: var(--loire); color: var(--tuffeau); margin-bottom: 18px;
}
.card-icon svg { width: 30px; height: 30px; }
.ticks { list-style: none; padding: 0; margin: 18px 0 0; }
.ticks li { padding: 7px 0 7px 30px; position: relative; border-top: 1px solid var(--tuffeau-2); }
.ticks li::before {
  content: ""; position: absolute; left: 2px; top: 13px; width: 16px; height: 9px;
  border-left: 2.5px solid var(--loire); border-bottom: 2.5px solid var(--loire);
  transform: rotate(-45deg);
}
@media (max-width: 760px) { .cards { grid-template-columns: 1fr; } }

/* Onglets carnet */
.tablist { display: inline-flex; flex-wrap: wrap; gap: 6px; padding: 6px; background: var(--paper); border: 1px solid var(--tuffeau-2); border-radius: 999px; margin-bottom: 20px; }
.tablist [role="tab"] {
  font: 600 .98rem/1 var(--sans); color: var(--muted);
  min-height: 44px; padding: 0 20px; border: 0; border-radius: 999px; background: transparent; cursor: pointer;
}
.tablist [role="tab"][aria-selected="true"] { background: var(--loire); color: #fff; }
.tablist [role="tab"]:hover:not([aria-selected="true"]) { color: var(--loire-deep); background: var(--tuffeau-2); }
.panel { background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.schedule { width: 100%; border-collapse: collapse; }
.schedule th, .schedule td { text-align: left; padding: 14px 20px; border-bottom: 1px solid var(--tuffeau-2); vertical-align: middle; }
.schedule thead th { font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); background: var(--tuffeau); }
.schedule tbody tr:last-child td { border-bottom: 0; }
.schedule td:last-child { width: 1%; white-space: nowrap; }
.freq { display: inline-block; font-size: .85rem; font-weight: 600; padding: 4px 12px; border-radius: 999px; }
.f1 { background: var(--loire); color: #fff; }
.f2 { background: var(--loire-soft); color: var(--loire-deep); }
.f3 { background: #f3e2c5; color: #6b4510; }
@media (max-width: 560px) {
  .schedule th, .schedule td { padding: 12px 14px; }
  .schedule td:last-child { white-space: normal; }
}

/* Étapes */
.steps { list-style: none; padding: 0; margin: 36px 0 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; counter-reset: s; position: relative; }
.steps::before {
  content: ""; position: absolute; left: 28px; right: 28px; top: 27px; height: 6px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 6'%3E%3Cpath d='M0 3c5-3 10-3 15 0s10 3 15 0 7-2 10-1.5' fill='none' stroke='%23d9cfbd' stroke-width='2'/%3E%3C/svg%3E") repeat-x left center/40px 6px;
}
.steps li { position: relative; }
.step-num {
  display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%;
  background: var(--paper); border: 2px solid var(--loire); color: var(--loire);
  font: 600 1.4rem/1 var(--serif); margin-bottom: 16px; position: relative;
}
.steps p { color: var(--muted); }
@media (max-width: 880px) {
  .steps { grid-template-columns: 1fr 1fr; }
  .steps::before { display: none; }
}
@media (max-width: 520px) { .steps { grid-template-columns: 1fr; } }

/* Zone */
.zone-inner { display: grid; grid-template-columns: 1fr 1.1fr; gap: 48px; align-items: center; }
.zone-map { margin: 0; }
.zone-map svg { width: 100%; height: auto; }
@media (max-width: 880px) { .zone-inner { grid-template-columns: 1fr; gap: 24px; } }

/* Devis */
.devis-inner { display: grid; grid-template-columns: .8fr 1.2fr; gap: clamp(32px, 5vw, 64px); align-items: start; }
.devis-aside { position: sticky; top: 104px; }
.contact-list { list-style: none; padding: 0; margin: 28px 0 0; }
.contact-list li { padding: 14px 0; border-top: 1px solid var(--tuffeau-2); display: flex; flex-direction: column; }
.contact-label { font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.contact-list a { font-weight: 600; font-size: 1.1rem; }
@media (max-width: 880px) {
  .devis-inner { grid-template-columns: 1fr; }
  .devis-aside { position: static; }
}

.form { background: var(--tuffeau); border: 1px solid var(--tuffeau-2); border-radius: 20px; padding: clamp(20px, 3.5vw, 36px); }
.form-note { font-size: .9rem; color: var(--muted); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
@media (max-width: 600px) { .grid-2 { grid-template-columns: 1fr; } }
.field { display: flex; flex-direction: column; margin-bottom: 18px; }
.field label, .choice legend { font-weight: 600; margin-bottom: 6px; color: var(--loire-deep); }
.field input, .field select, .field textarea {
  font: inherit; color: var(--ink); background: var(--paper);
  border: 1.5px solid #b9ad97; border-radius: 10px; padding: .7em .85em; min-height: 48px; width: 100%;
}
.field textarea { resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--loire); outline: 3px solid rgba(18,62,87,.18); outline-offset: 0; }
.field [aria-invalid="true"] { border-color: var(--danger); }
.hint { font-size: .85rem; color: var(--muted); margin-top: 4px; }
.error { font-size: .88rem; color: var(--danger); margin-top: 4px; font-weight: 500; }

.choice { border: 0; padding: 0; margin: 0 0 18px; }
.choice-row { display: flex; flex-wrap: wrap; gap: 8px; }
.choice-row label {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  padding: 10px 14px; min-height: 44px; border: 1.5px solid #b9ad97; border-radius: 999px; background: var(--paper);
}
.choice-row label:has(input:checked) { border-color: var(--loire); background: var(--loire-soft); }
.choice-row input { accent-color: var(--loire); width: 18px; height: 18px; margin: 0; }

.consent { display: flex; gap: 12px; align-items: flex-start; margin: 4px 0 8px; }
.consent input { accent-color: var(--loire); width: 22px; height: 22px; margin: 2px 0 0; flex: none; }
.form-status { margin: 14px 0 0; font-weight: 600; min-height: 1.5em; }
.form-status.ok { color: var(--ok); }
.form-status.err { color: var(--danger); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* FAQ */
.faq { margin-top: 28px; }
.faq details { background: var(--paper); border: 1px solid var(--tuffeau-2); border-radius: 12px; margin-bottom: 10px; }
.faq summary {
  cursor: pointer; list-style: none; padding: 18px 56px 18px 20px; position: relative;
  font-weight: 600; color: var(--loire-deep);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; position: absolute; right: 22px; top: 50%; width: 10px; height: 10px; margin-top: -7px;
  border-right: 2px solid var(--loire); border-bottom: 2px solid var(--loire); transform: rotate(45deg);
  transition: transform .2s;
}
.faq details[open] summary::after { transform: rotate(-135deg); margin-top: -2px; }
.faq details p { padding: 0 20px 18px; margin: 0; color: var(--muted); }

/* ---------- Pied de page ---------- */
.site-footer { background: var(--loire-deep); color: #c9d6de; padding: 56px 0 24px; }
.site-footer a { color: #fff; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 32px; }
.footer-brand { font-family: var(--serif); font-size: 1.4rem; color: #fff; margin-bottom: .3em; }
address { font-style: normal; margin-top: 12px; line-height: 1.8; }
.footer-links { list-style: none; padding: 0; margin: 0; line-height: 2.2; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.12); margin-top: 36px; padding-top: 18px; font-size: .9rem; }
.footer-bottom p { margin: 0; }
.site-footer .todo { background: rgba(227,168,87,.25); outline-color: var(--ocre); }

/* ---------- Pages légales ---------- */
.legal { padding: clamp(40px, 7vw, 80px) 0; background: var(--paper); }
.legal h1 { font-size: clamp(2rem, 4vw, 2.8rem); }
.legal h2 { font-size: 1.4rem; margin-top: 1.8em; }
.legal dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 20px; }
.legal dt { font-weight: 600; color: var(--loire-deep); }
.legal dd { margin: 0; }
@media (max-width: 560px) { .legal dl { grid-template-columns: 1fr; } .legal dd { margin-bottom: 10px; } }
.back { display: inline-block; margin-bottom: 24px; }

/* Apparition douce au défilement */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s ease, transform .6s ease; }
.reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}

@media print {
  .site-header, .hero-art, .divider, .form, .nav-toggle { display: none !important; }
  body { background: #fff; }
}

/* ---------- Référencement : liens services, communes, pages services ---------- */
.card-link { display: inline-block; margin-top: 18px; font-weight: 600; position: relative; z-index: 1; }
.communes { list-style: none; padding: 0; margin: 4px 0 18px; display: flex; flex-wrap: wrap; gap: 6px; }
.communes li { font-size: .85rem; padding: 4px 10px; border: 1px solid rgba(245,240,230,.25); border-radius: 999px; color: #e7eef2; }
.page-hero { padding: clamp(40px, 7vw, 80px) 0 clamp(24px, 4vw, 40px); }
.page-hero .lead { margin-bottom: 0; }
.breadcrumb { font-size: .9rem; color: var(--muted); margin-bottom: 18px; }
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0; }
.breadcrumb li + li::before { content: "›"; margin-right: 6px; }
.prose { max-width: 46em; }
.prose h2 { font-size: clamp(1.4rem, 2.6vw, 1.9rem); margin-top: 1.6em; }
.prose ul { padding-left: 1.2em; }
.prose li { margin-bottom: .35em; }
.cta-band { background: var(--loire-deep); color: #e7eef2; border-radius: 20px; padding: clamp(24px, 4vw, 40px); margin-top: 48px; display: flex; flex-wrap: wrap; gap: 20px; align-items: center; justify-content: space-between; }
.cta-band h2 { color: #fff; margin: 0 0 .2em; font-size: clamp(1.4rem, 2.6vw, 1.8rem); }
.cta-band p { margin: 0; }
.cta-band .btn { background: var(--ocre); border-color: var(--ocre); color: var(--loire-deep); }
.cta-band .btn:hover { background: #fff; border-color: #fff; color: var(--loire-deep); }
.cta-band a:not(.btn) { color: #fff; }
