/* ======================================================================
   KS Service — design system (client site + shared atoms for pro/devis)
   ====================================================================== */

:root {
  --ink: #16241e;
  --muted: #5d6e64;
  --leaf: #1f7a4d;
  --leaf-dark: #103a2a;
  --sun: #f0b429;
  --clay: #cf6548;
  --sky: #2b6f86;
  --paper: #ffffff;
  --mist: #eef5f0;
  --bg: #f6f9f6;
  --line: #e3ece6;
  --shadow: 0 22px 60px -28px rgba(16, 58, 42, 0.35);
  --shadow-sm: 0 10px 30px -16px rgba(16, 58, 42, 0.3);
  --radius: 16px;
  --radius-lg: 22px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img, svg, video { max-width: 100%; }
button, input, select, textarea { font: inherit; }

h1, h2, h3 { margin: 0; line-height: 1.08; letter-spacing: -0.02em; }

.container { width: min(1140px, calc(100% - 2.5rem)); margin-inline: auto; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: fixed; left: 1rem; top: 1rem; z-index: 60;
  padding: 0.65rem 0.9rem; background: var(--sun); color: #1d1604;
  border-radius: 10px; transform: translateY(-150%); transition: transform 0.16s ease;
}
.skip-link:focus { transform: translateY(0); }

/* ---------- Buttons (client: .btn) ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 2.85rem; padding: 0.7rem 1.25rem;
  border: 1.5px solid transparent; border-radius: 999px;
  font-weight: 800; cursor: pointer; white-space: nowrap;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}
.btn svg { width: 1.05rem; height: 1.05rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--leaf); color: #fff; box-shadow: 0 14px 30px -12px rgba(31, 122, 77, 0.7); }
.btn-primary:hover { background: #1b6c44; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-light { background: rgba(255, 255, 255, 0.16); color: #fff; border-color: rgba(255, 255, 255, 0.4); backdrop-filter: blur(8px); }
.btn-lg { min-height: 3.4rem; padding-inline: 1.6rem; font-size: 1.05rem; }
.btn-block { width: 100%; }

/* ---------- Buttons (pro app + devis page: .button) ---------- */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 3rem; padding: 0.75rem 1.1rem; border: 1.5px solid transparent;
  border-radius: 12px; cursor: pointer; font-weight: 800; text-align: center;
  transition: transform 0.12s ease, background 0.12s ease;
}
.button svg { width: 1.1rem; height: 1.1rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.button:hover, .button:focus-visible { transform: translateY(-1px); }
.button.primary { background: var(--leaf); color: #fff; box-shadow: 0 14px 28px -14px rgba(31, 122, 77, 0.8); }
.button.secondary { background: #fff; color: var(--leaf-dark); border-color: var(--line); }

/* ---------- Brand ---------- */
.brand { display: inline-flex; align-items: center; gap: 0.65rem; }
.brand-mark {
  display: grid; place-items: center; width: 2.75rem; height: 2.75rem;
  border-radius: 12px; background: var(--leaf-dark); color: #fff; font-weight: 900;
}
.brand-text strong { display: block; line-height: 1.1; }
.brand-text small { display: block; color: var(--muted); font-size: 0.8rem; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.7rem max(1.25rem, calc((100% - 1140px) / 2));
  background: rgba(255, 255, 255, 0.85);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}
.nav { display: flex; gap: 0.35rem; }
.nav a { padding: 0.55rem 0.85rem; border-radius: 10px; color: var(--muted); font-weight: 700; }
.nav a:hover { background: var(--mist); color: var(--ink); }
.header-cta { display: flex; align-items: center; gap: 0.6rem; }

/* ---------- Hero ---------- */
.hero { position: relative; isolation: isolate; min-height: min(86vh, 760px); display: grid; align-items: center; color: #fff; overflow: hidden; }
.hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.hero-shade {
  position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(100deg, rgba(8, 26, 19, 0.95) 0%, rgba(8, 26, 19, 0.7) 45%, rgba(8, 26, 19, 0.2) 100%),
    linear-gradient(0deg, rgba(8, 26, 19, 0.7), rgba(8, 26, 19, 0) 55%);
}
.hero-inner { padding-block: clamp(3rem, 9vh, 6rem); }
.hero h1 { font-size: clamp(2.9rem, 6.5vw, 5.4rem); margin: 1rem 0; text-shadow: 0 2px 30px rgba(0, 0, 0, 0.25); }
.hero-lead { max-width: 32rem; font-size: clamp(1.1rem, 2vw, 1.35rem); color: rgba(255, 255, 255, 0.92); }
.hero-lead strong { color: #ffe09a; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.8rem; }

.pill {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.45rem 0.9rem; border-radius: 999px; font-weight: 800; font-size: 0.88rem;
}
.pill-light { background: rgba(255, 255, 255, 0.14); border: 1px solid rgba(255, 255, 255, 0.4); color: #fff; backdrop-filter: blur(8px); }

/* ---------- Trust strip ---------- */
.trust {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem;
  margin-top: -2.5rem; position: relative; z-index: 2;
  padding: 1.25rem; background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius-lg); box-shadow: var(--shadow);
}
.trust-item { display: flex; align-items: center; gap: 0.7rem; }
.trust-ico { font-size: 1.5rem; }
.trust-item strong { display: block; }
.trust-item small { color: var(--muted); }

/* ---------- Sections ---------- */
.section { padding-block: clamp(3.5rem, 8vw, 6rem); }
.section-alt { padding-block: clamp(3.5rem, 8vw, 6rem); background: #fff; border-block: 1px solid var(--line); }
.section-head { max-width: 42rem; margin-bottom: 2rem; }
.section-head.center { margin-inline: auto; text-align: center; }
.eyebrow { margin: 0 0 0.6rem; color: var(--leaf); font-weight: 900; font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase; }
h2 { font-size: clamp(1.9rem, 4vw, 3rem); }
.section-sub { color: var(--muted); font-size: 1.08rem; margin: 0.6rem 0 0; }

/* ---------- Cards ---------- */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.card {
  padding: 1.75rem; background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.card h3 { font-size: 1.3rem; margin-bottom: 0.5rem; }
.card p { color: var(--muted); margin: 0; }
.card-ico { display: grid; place-items: center; width: 3.2rem; height: 3.2rem; border-radius: 14px; margin-bottom: 1.1rem; color: #fff; }
.card-ico svg { width: 1.6rem; height: 1.6rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ico-green { background: var(--leaf); }
.ico-blue { background: var(--sky); }
.ico-clay { background: var(--clay); }

/* ---------- Steps ---------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.step { padding: 1.6rem; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); }
.step-num { display: grid; place-items: center; width: 2.5rem; height: 2.5rem; border-radius: 999px; background: var(--leaf-dark); color: #fff; font-weight: 900; margin-bottom: 0.9rem; }
.step h3 { font-size: 1.2rem; margin-bottom: 0.35rem; }
.step p { color: var(--muted); margin: 0; }

/* ---------- Crédit d'impôt ---------- */
.tax { display: grid; grid-template-columns: 1.3fr 0.7fr; gap: 1.5rem; align-items: start; }
.tax-text p { color: var(--muted); font-size: 1.06rem; }
.tax-text .btn { margin-top: 0.8rem; }
.tax-note { padding: 1.5rem; border-radius: var(--radius); background: var(--mist); border: 1px solid var(--line); border-left: 5px solid var(--sun); }
.tax-note strong { display: block; margin-bottom: 0.4rem; color: var(--leaf-dark); }
.tax-note p { margin: 0; color: var(--muted); }

/* ---------- Contact / formulaire ---------- */
.contact { display: grid; grid-template-columns: 0.85fr 1.15fr; gap: 2rem; align-items: start; }
.contact-info h2 { margin-bottom: 0.6rem; }
.contact-info > p { color: var(--muted); font-size: 1.06rem; }
.contact-points { list-style: none; margin: 1.25rem 0; padding: 0; display: grid; gap: 0.55rem; }
.contact-points li { display: flex; align-items: center; gap: 0.6rem; font-weight: 700; }
.contact-points span { display: grid; place-items: center; width: 1.5rem; height: 1.5rem; border-radius: 999px; background: var(--leaf); color: #fff; font-size: 0.8rem; }
.contact-card { padding: 1.1rem 1.25rem; border-radius: var(--radius); background: var(--leaf-dark); color: #fff; }
.contact-phone { display: block; font-size: 1.5rem; font-weight: 900; }
.contact-card span { color: rgba(255, 255, 255, 0.8); font-size: 0.9rem; }

.form-card {
  display: grid; gap: 1rem; padding: clamp(1.4rem, 3vw, 2.1rem);
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow);
}
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.field { display: grid; gap: 0.4rem; }
.field > span, .field-label { font-weight: 700; font-size: 0.9rem; color: var(--ink); }
.field i { color: var(--clay); font-style: normal; }
.field em { color: var(--muted); font-style: normal; font-weight: 600; font-size: 0.85em; }

.field input, .field select, .field textarea {
  width: 100%; padding: 0.9rem 1rem; border: 1.5px solid var(--line); border-radius: 12px;
  background: #fcfdfc; font-size: 1rem; color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field textarea { resize: vertical; min-height: 6rem; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--leaf); box-shadow: 0 0 0 4px rgba(31, 122, 77, 0.12);
}

/* chips */
.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chip { display: inline-flex; align-items: center; }
.chip input { position: absolute; opacity: 0; width: 0; height: 0; }
.chip span {
  display: inline-block; padding: 0.55rem 0.95rem; border: 1.5px solid var(--line);
  border-radius: 999px; background: #fff; font-weight: 700; font-size: 0.92rem; cursor: pointer;
  transition: all 0.12s ease;
}
.chip input:checked + span { border-color: var(--leaf); background: var(--mist); color: var(--leaf-dark); box-shadow: 0 0 0 1px var(--leaf) inset; }
.chip input:focus-visible + span { box-shadow: 0 0 0 4px rgba(31, 122, 77, 0.18); }

.file-field input[type="file"] { padding: 0.75rem; border: 1.5px dashed var(--line); border-radius: 12px; background: #fcfdfc; }
.file-hint { color: var(--muted); font-size: 0.85rem; }
.photo-list { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.photo-list span { padding: 0.3rem 0.6rem; border-radius: 8px; background: var(--mist); font-size: 0.82rem; font-weight: 700; overflow-wrap: anywhere; }

.form-note { margin: -0.4rem 0 0; text-align: center; color: var(--muted); font-size: 0.9rem; }

.prepared-message { display: grid; gap: 0.5rem; padding: 1rem 1.15rem; border: 1px solid var(--line); border-radius: 12px; background: var(--mist); }
.prepared-message.is-success { border-color: #b6dcc6; background: #ecf7f0; }
.prepared-message.is-success strong { color: #1c7c54; }
.prepared-message.is-error { border-color: #e6b0a6; background: #fbeeeb; }
.prepared-message.is-error strong { color: #c0392b; }
.photo-note { margin: 0; color: var(--muted); }

/* ---------- Footer ---------- */
.site-footer { background: var(--leaf-dark); color: rgba(255, 255, 255, 0.85); padding-block: 2.5rem 1.5rem; }
.footer-grid { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1.5rem; }
.brand-footer .brand-mark { background: rgba(255, 255, 255, 0.14); }
.brand-footer .brand-text small { color: rgba(255, 255, 255, 0.7); }
.footer-desc { max-width: 26rem; margin: 0.8rem 0 0; color: rgba(255, 255, 255, 0.75); }
.footer-contact { display: grid; gap: 0.3rem; align-content: start; }
.footer-phone { font-size: 1.3rem; font-weight: 900; color: #fff; }
.footer-contact a { color: rgba(255, 255, 255, 0.85); }
.footer-tag { color: rgba(255, 255, 255, 0.6); font-size: 0.85rem; max-width: 22rem; }
.footer-legal { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; margin-top: 1.75rem; padding-top: 1.25rem; border-top: 1px solid rgba(255, 255, 255, 0.15); font-size: 0.85rem; }
.footer-legal summary { cursor: pointer; font-weight: 700; color: #fff; }
.footer-legal p { margin: 0.6rem 0 0; color: rgba(255, 255, 255, 0.7); line-height: 1.6; max-width: 60ch; }
.footer-copy { color: rgba(255, 255, 255, 0.6); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .nav { display: none; }
  .tax, .contact { grid-template-columns: 1fr; }
  .cards, .steps { grid-template-columns: 1fr; }
  .trust { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .field-row { grid-template-columns: 1fr; }
  .trust { grid-template-columns: 1fr; }
  .hero-cta .btn { flex: 1 1 auto; }
  .header-cta .btn-ghost span { display: none; }
}
@media (hover: none) and (pointer: coarse) {
  .btn, .button, .chip span { min-height: 44px; }
}
@media (hover: none) and (pointer: coarse) and (max-width: 768px) {
  input, select, textarea { font-size: 16px; }
}

/* ====================================================================
   Formulaire de demande — version premium
   ==================================================================== */
.contact .contact-info h2{ font-size:clamp(1.8rem,3.5vw,2.6rem); }
.form-card{
  position:relative; display:grid; gap:1.1rem;
  padding:clamp(1.4rem,3vw,2.2rem);
  background:#fff; border:1px solid var(--line);
  border-radius:22px; box-shadow:0 30px 70px -40px rgba(16,58,42,.5);
}
.form-card::before{ content:"Devis gratuit · réponse rapide"; display:block; justify-self:start;
  font-size:.78rem; font-weight:800; letter-spacing:.04em; text-transform:uppercase;
  color:var(--leaf); background:var(--mist); padding:.4rem .8rem; border-radius:999px; }
.form-card .field{ display:grid; gap:.45rem; }
.form-card .field>span,.form-card .field-label{ font-weight:700; font-size:.9rem; color:var(--ink); }
.form-card .field i{ color:var(--clay); font-style:normal; }
.form-card .field em{ color:var(--muted); font-weight:600; font-style:normal; font-size:.85em; }
.form-card .field-row{ display:grid; grid-template-columns:1fr 1fr; gap:.9rem; }
.form-card input,.form-card select,.form-card textarea{
  width:100%; padding:.95rem 1rem; border:1.6px solid var(--line); border-radius:13px;
  background:#fbfdfb; font-size:1rem; color:var(--ink); transition:border-color .15s,box-shadow .15s,background .15s;
}
.form-card input::placeholder,.form-card textarea::placeholder{ color:#9aa8a0; }
.form-card input:hover,.form-card select:hover,.form-card textarea:hover{ border-color:#cdd9d0; }
.form-card input:focus,.form-card select:focus,.form-card textarea:focus{
  outline:none; border-color:var(--leaf); background:#fff; box-shadow:0 0 0 4px rgba(31,138,76,.14);
}
.form-card textarea{ resize:vertical; min-height:7rem; }

/* Pastilles services */
.form-card .chips{ display:flex; flex-wrap:wrap; gap:.5rem; }
.form-card .chip{ position:relative; }
.form-card .chip input{ position:absolute; opacity:0; inset:0; cursor:pointer; }
.form-card .chip span{
  display:inline-flex; align-items:center; gap:.4rem; padding:.6rem 1rem;
  border:1.6px solid var(--line); border-radius:999px; background:#fff;
  font-weight:700; font-size:.92rem; color:var(--ink); cursor:pointer; transition:all .12s;
}
.form-card .chip span::before{ content:"+"; font-weight:900; color:var(--muted); }
.form-card .chip:hover span{ border-color:#cdd9d0; }
.form-card .chip input:checked+span{ border-color:var(--leaf); background:var(--mist); color:var(--leaf-dark); }
.form-card .chip input:checked+span::before{ content:"✓"; color:var(--leaf); }
.form-card .chip input:focus-visible+span{ box-shadow:0 0 0 4px rgba(31,138,76,.18); }

/* Zone photo */
.form-card .file-field{ }
.form-card .file-field input[type="file"]{
  padding:1rem; border:1.6px dashed #bcd0c2; border-radius:13px; background:#f6faf6;
  font-size:.9rem; cursor:pointer;
}
.form-card .file-field input[type="file"]:hover{ border-color:var(--leaf); background:var(--mist); }
.file-hint{ color:var(--muted); font-size:.83rem; }
.photo-list{ display:flex; flex-wrap:wrap; gap:.4rem; }
.photo-list span{ padding:.3rem .6rem; border-radius:8px; background:var(--mist); color:var(--leaf-dark); font-size:.8rem; font-weight:700; }

/* CTA */
.form-card .btn-block{ margin-top:.3rem; min-height:3.5rem; font-size:1.1rem; border-radius:14px; box-shadow:0 16px 34px -14px rgba(31,138,76,.7); }
.form-note{ margin:0; text-align:center; color:var(--muted); font-size:.88rem; }

/* Confirmation */
.prepared-message{ display:grid; gap:.35rem; padding:1rem 1.15rem; border-radius:13px; background:var(--mist); border:1px solid var(--line); }
.prepared-message strong{ font-size:1.05rem; }
.prepared-message.is-success{ background:#ecf7f0; border-color:#b6dcc6; }
.prepared-message.is-success strong{ color:#1c7c54; }
.prepared-message.is-error{ background:#fbeeeb; border-color:#e6b0a6; }
.prepared-message.is-error strong{ color:#c0392b; }
.photo-note{ margin:0; color:var(--muted); }

@media(max-width:560px){ .form-card .field-row{ grid-template-columns:1fr; } }

/* ====================================================================
   Audit fixes — logo, contraste, focus, RGPD, erreurs, pages légales
   ==================================================================== */
:root{ --muted:#4a5a50; }   /* contraste AA renforcé */
.brand-logo{ width:46px; height:46px; object-fit:contain; border-radius:10px; }
.brand-footer .brand-logo{ background:#fff; padding:3px; }

/* Focus clavier visible partout */
a:focus-visible,button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,.btn:focus-visible{
  outline:3px solid var(--leaf); outline-offset:2px; border-radius:8px;
}

/* Mention RGPD sous le formulaire */
.form-rgpd{ margin:.2rem 0 0; font-size:.78rem; color:var(--muted); line-height:1.5; }
.form-rgpd a{ color:var(--leaf); text-decoration:underline; }

/* Champ en erreur */
.form-card input.field-err,.form-card textarea.field-err,.form-card select.field-err{ border-color:#c0392b; box-shadow:0 0 0 3px rgba(192,57,43,.14); }

/* Liens légaux footer */
.footer-links{ display:flex; flex-wrap:wrap; gap:1.2rem; }
.footer-links a{ color:rgba(255,255,255,.85); text-decoration:underline; font-weight:600; }
.footer-links a:hover{ color:#fff; }

/* Pages légales */
.legal-page{ width:min(820px,calc(100% - 2.5rem)); margin:2.5rem auto 4rem; }
.legal-page h1{ font-size:clamp(1.8rem,4vw,2.6rem); margin-bottom:1.2rem; }
.legal-page h2{ font-size:1.25rem; margin:1.8rem 0 .5rem; }
.legal-page p,.legal-page li{ color:#33433b; line-height:1.65; }
.legal-page a{ color:var(--leaf); text-decoration:underline; }
.legal-back{ display:inline-flex; align-items:center; gap:.4rem; margin-bottom:1.5rem; color:var(--leaf); font-weight:700; }
