/* =========================================================
   SIBAT — Plâtrerie · Peinture · Carrelage
   5 thèmes de couleur pilotés par l'attribut data-theme
   ========================================================= */

:root,
[data-theme="orange"] {
  --primary: #e4572e;
  --primary-strong: #c2441f;
  --primary-soft: #fdebe4;
  --on-primary: #ffffff;
  --accent: #8d9399;
  --ink: #1f2328;
  --text: #33383e;
  --muted: #646b73;
  --bg: #ffffff;
  --surface: #f6f3ef;
  --card: #ffffff;
  --border: #e6e1da;
  --hero-from: #2b2f34;
  --hero-to: #3d4249;
  --hero-text: #ffffff;
  --footer: #22262b;
  --shadow: 0 10px 30px rgba(31, 35, 40, .08);
  --tile: rgba(255, 255, 255, .045);
}
[data-theme="ardoise"] {
  --primary: #1f5fa8;
  --primary-strong: #164a85;
  --primary-soft: #e3edf9;
  --accent: #f2a23a;
  --surface: #f2f5f9;
  --border: #dde4ee;
  --hero-from: #0f2a4a;
  --hero-to: #1b416e;
  --footer: #0f2238;
}
[data-theme="olive"] {
  --primary: #3f7d58;
  --primary-strong: #2f6144;
  --primary-soft: #e4f0e8;
  --accent: #c9a44c;
  --surface: #f3f5ef;
  --border: #dfe5d8;
  --hero-from: #1f3328;
  --hero-to: #2e4a3a;
  --footer: #1a2a21;
}
[data-theme="terracotta"] {
  --primary: #a63d2f;
  --primary-strong: #862f23;
  --primary-soft: #f6e4df;
  --accent: #d9a066;
  --surface: #f8f1ea;
  --border: #eadfd3;
  --hero-from: #3b231c;
  --hero-to: #5a3328;
  --footer: #2e1c17;
}
[data-theme="sombre"] {
  --primary: #ff7a45;
  --primary-strong: #ff9466;
  --primary-soft: rgba(255, 122, 69, .14);
  --on-primary: #14171b;
  --accent: #9aa3ad;
  --ink: #f1f3f5;
  --text: #d5d9de;
  --muted: #9aa3ad;
  --bg: #14171b;
  --surface: #1b1f24;
  --card: #22272d;
  --border: #2f353c;
  --hero-from: #0d0f12;
  --hero-to: #1a1e23;
  --footer: #0d0f12;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --tile: rgba(255, 255, 255, .03);
  color-scheme: dark;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 84px; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }

body {
  margin: 0;
  font-family: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); }
h1, h2, h3 { color: var(--ink); line-height: 1.2; margin: 0 0 .6em; letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 4.6vw, 3.3rem); font-weight: 800; }
h2 { font-size: clamp(1.6rem, 3.2vw, 2.4rem); font-weight: 800; }
h3 { font-size: 1.2rem; font-weight: 700; }
p { margin: 0 0 1em; }
svg { width: 1.25em; height: 1.25em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }

.container { width: min(1180px, 100% - 32px); margin-inline: auto; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--primary); color: var(--on-primary); padding: 8px 14px; border-radius: 6px; z-index: 100; }
.skip:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  padding: .85em 1.5em; border-radius: 10px; border: 2px solid var(--primary);
  background: var(--primary); color: var(--on-primary); font: inherit; font-weight: 700;
  text-decoration: none; cursor: pointer; transition: background .2s, transform .2s, border-color .2s;
}
.btn:hover { background: var(--primary-strong); border-color: var(--primary-strong); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--hero-text); border-color: rgba(255, 255, 255, .45); }
.btn-ghost:hover { background: rgba(255, 255, 255, .1); border-color: #fff; }
.btn-sm { padding: .5em 1em; font-size: .92rem; }
.btn-block { width: 100%; }
.link { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; text-decoration: underline; }

/* ---------- En-tête ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.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(--ink); min-width: 0; }
.brand-logo { display: inline-flex; width: 52px; flex-shrink: 0; }
[data-theme="sombre"] .brand-logo { background: #fff; border-radius: 10px; padding: 4px 6px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand-text strong { font-size: 1.35rem; font-weight: 800; letter-spacing: .06em; }
.brand-text small { font-size: .78rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.nav { display: flex; align-items: center; gap: 26px; }
.nav a { color: var(--text); text-decoration: none; font-weight: 600; font-size: .95rem; }
.nav a:not(.btn):hover { color: var(--primary); }
.nav .nav-cta { color: var(--on-primary); }
.nav-toggle { display: none; }

@media (max-width: 920px) {
  .nav-toggle {
    display: inline-flex; flex-direction: column; justify-content: center; gap: 5px;
    width: 44px; height: 44px; padding: 10px; border: 1px solid var(--border); border-radius: 10px;
    background: var(--card); cursor: pointer;
  }
  .nav-toggle span { display: block; height: 2px; background: var(--ink); border-radius: 2px; transition: transform .25s, opacity .25s; }
  .nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .nav {
    position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--border); box-shadow: var(--shadow);
    padding: 8px 16px 16px; display: none;
  }
  .nav.open { display: flex; }
  .nav a { padding: 12px 4px; border-bottom: 1px solid var(--border); }
  .nav .nav-cta { margin-top: 12px; border-bottom: 0; padding: 12px; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative; color: var(--hero-text);
  background:
    linear-gradient(90deg, var(--tile) 1px, transparent 1px) 0 0 / 64px 64px,
    linear-gradient(0deg, var(--tile) 1px, transparent 1px) 0 0 / 64px 64px,
    linear-gradient(135deg, var(--hero-from), var(--hero-to));
  padding: clamp(56px, 9vw, 110px) 0 clamp(90px, 11vw, 140px);
  overflow: hidden;
}
.hero.has-image {
  background:
    linear-gradient(100deg, color-mix(in srgb, var(--hero-from) 94%, transparent) 30%, color-mix(in srgb, var(--hero-from) 55%, transparent)),
    var(--hero-img) center / cover no-repeat;
}
.hero::before {
  content: ""; position: absolute; right: -8%; top: -30%; width: 55%; aspect-ratio: 1;
  background: radial-gradient(circle, color-mix(in srgb, var(--primary) 35%, transparent), transparent 65%);
  pointer-events: none;
}
.hero-inner { position: relative; display: grid; grid-template-columns: 1.35fr 1fr; gap: 56px; align-items: center; }
.hero h1 { color: var(--hero-text); }
.kicker {
  display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: .85rem; letter-spacing: .04em;
  text-transform: uppercase; color: #fff; background: color-mix(in srgb, var(--primary) 85%, transparent);
  padding: 6px 12px; border-radius: 999px; margin-bottom: 18px;
}
.lead { font-size: 1.15rem; color: rgba(255, 255, 255, .85); max-width: 40em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0 26px; }
[data-theme="sombre"] .hero .btn:not(.btn-ghost) { color: var(--on-primary); }
.hero-trades { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 10px 22px; }
.hero-trades li { display: flex; align-items: center; gap: 8px; font-weight: 600; color: rgba(255, 255, 255, .9); }
.hero-trades li::before { content: ""; width: 10px; height: 10px; background: var(--primary); transform: rotate(45deg); border-radius: 2px; }

.hero-card {
  background: #fff; color: #33383e; border-radius: 20px; padding: 30px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, .3); text-align: center;
  position: relative;
}
.hero-card::before {
  content: ""; position: absolute; inset: -10px 18px auto; height: 10px;
  background: var(--primary); border-radius: 10px 10px 0 0;
}
.hero-logo { width: 150px; margin: 0 auto 18px; }
.rating {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  text-decoration: none; color: #33383e; padding: 12px; border-radius: 12px; background: #f6f3ef; margin-bottom: 18px;
}
.rating:hover { background: #efe9e2; }
.stars { color: #f5b301; letter-spacing: 3px; font-size: 1.3rem; line-height: 1; }
.hero-badges { display: grid; grid-template-columns: 1fr 1.4fr; gap: 16px; align-items: center; }
.hero-badges img { max-height: 110px; width: auto; margin: auto; }

.hero-roof { position: absolute; bottom: -1px; left: 0; width: 100%; height: clamp(40px, 6vw, 90px); fill: var(--bg); stroke: none; }

@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; gap: 40px; }
  .hero-card { max-width: 420px; width: 100%; margin-inline: auto; }
}

/* ---------- Sections ---------- */
.section { padding: clamp(64px, 9vw, 104px) 0; }
.section-alt { background: var(--surface); }
.section-head { max-width: 720px; margin: 0 auto 48px; text-align: center; }
.section-head p:last-child { color: var(--muted); }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px; color: var(--primary); font-weight: 800;
  text-transform: uppercase; letter-spacing: .12em; font-size: .8rem; margin-bottom: 10px;
}
.eyebrow::before { content: ""; width: 22px; height: 3px; background: currentColor; border-radius: 2px; }

/* Prestations */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: 18px; padding: 32px 28px;
  box-shadow: var(--shadow); transition: transform .25s, border-color .25s; position: relative; overflow: hidden;
}
.card::after { content: ""; position: absolute; left: 0; top: 0; height: 4px; width: 100%; background: var(--primary); transform: scaleX(0); transform-origin: left; transition: transform .3s; }
.card:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--primary) 40%, var(--border)); }
.card:hover::after { transform: scaleX(1); }
.card-icon {
  width: 60px; height: 60px; display: grid; place-items: center; border-radius: 16px;
  background: var(--primary-soft); color: var(--primary); margin-bottom: 20px;
}
.card-icon svg { width: 30px; height: 30px; }
.card p { color: var(--muted); }
.checks { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.checks li { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; font-size: .95rem; }
.checks li::before {
  content: ""; flex-shrink: 0; width: 18px; height: 18px; margin-top: 4px; border-radius: 50%;
  background: var(--primary) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12l4 4 8-8'/%3E%3C/svg%3E") center / 12px no-repeat;
}
@media (max-width: 900px) { .cards { grid-template-columns: 1fr; max-width: 560px; margin-inline: auto; } }

/* L'entreprise */
.about { display: grid; grid-template-columns: 1.1fr 1fr; gap: 64px; align-items: center; }
.zone {
  display: flex; gap: 12px; align-items: flex-start; background: var(--card); border: 1px solid var(--border);
  border-left: 4px solid var(--primary); border-radius: 12px; padding: 16px 18px; margin-top: 24px;
}
.zone svg { color: var(--primary); margin-top: 3px; }
.features { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.feature { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 24px; }
.feature svg { width: 32px; height: 32px; color: var(--primary); margin-bottom: 12px; }
.feature h3 { font-size: 1.05rem; margin-bottom: .3em; }
.feature p { margin: 0; color: var(--muted); font-size: .95rem; }
@media (max-width: 900px) { .about { grid-template-columns: 1fr; gap: 40px; } }
@media (max-width: 480px) { .features { grid-template-columns: 1fr; } }

/* Réalisations */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.gallery figure { margin: 0; border-radius: 14px; overflow: hidden; background: var(--card); border: 1px solid var(--border); }
.gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; transition: transform .4s; }
.gallery a { display: block; overflow: hidden; }
.gallery a:hover img { transform: scale(1.05); }
.gallery figcaption { padding: 10px 14px; font-size: .9rem; color: var(--muted); }

/* Certifications */
.certs-section { background: var(--bg); }
.certs { display: grid; grid-template-columns: 1fr 1.2fr; gap: 64px; align-items: center; }
.cert-logos { display: grid; grid-template-columns: 1fr 1.3fr; gap: 20px; }
.cert-logos figure {
  margin: 0; background: #fff; border: 1px solid var(--border); border-radius: 18px; padding: 28px 20px 16px;
  display: flex; flex-direction: column; align-items: center; justify-content: space-between; gap: 14px; box-shadow: var(--shadow);
}
.cert-logos img { max-height: 170px; width: auto; }
.cert-logos figcaption { font-weight: 700; color: #33383e; font-size: .9rem; }
@media (max-width: 900px) { .certs { grid-template-columns: 1fr; gap: 40px; } }
@media (max-width: 420px) { .cert-logos { grid-template-columns: 1fr; } }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1.25fr; gap: 32px; align-items: start; }
@media (max-width: 900px) { .contact-grid { grid-template-columns: 1fr; } }
.contact-info { display: grid; gap: 20px; }
.info-block, .contact-form {
  background: var(--card); border: 1px solid var(--border); border-radius: 18px; padding: 28px; box-shadow: var(--shadow);
}
.info-block h3 { display: flex; align-items: center; gap: 10px; }
.info-block h3::before { content: ""; width: 8px; height: 22px; background: var(--primary); border-radius: 4px; }
.info-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.info-list li { display: flex; gap: 14px; align-items: flex-start; }
.info-list svg { width: 40px; height: 40px; padding: 9px; border-radius: 12px; background: var(--primary-soft); color: var(--primary); }
.info-list address { font-style: normal; }
.info-list a { color: var(--ink); font-weight: 700; text-decoration: none; font-size: 1.05rem; }
.info-list a:hover { color: var(--primary); }
.hours { width: 100%; border-collapse: collapse; }
.hours th, .hours td { padding: 9px 4px; border-bottom: 1px dashed var(--border); text-align: left; font-weight: 500; }
.hours td { text-align: right; font-variant-numeric: tabular-nums; }
.hours tr:last-child th, .hours tr:last-child td { border-bottom: 0; }
.hours .today th, .hours .today td { color: var(--primary); font-weight: 800; }
.hours .closed { color: var(--muted); }
.map { border-radius: 18px; overflow: hidden; border: 1px solid var(--border); min-height: 240px; background: var(--card); }
.map iframe { width: 100%; height: 300px; border: 0; display: block; }
.map-load {
  width: 100%; min-height: 240px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  border: 0; cursor: pointer; font: inherit; font-weight: 700; color: var(--ink);
  background:
    linear-gradient(90deg, var(--border) 1px, transparent 1px) 0 0 / 28px 28px,
    linear-gradient(0deg, var(--border) 1px, transparent 1px) 0 0 / 28px 28px, var(--surface);
}
.map-load svg { width: 36px; height: 36px; color: var(--primary); }
.map-load small { font-weight: 500; color: var(--muted); }

.contact-form { display: grid; gap: 16px; }
.contact-form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 560px) { .contact-form .row { grid-template-columns: 1fr; } .info-block, .contact-form { padding: 22px 18px; } }
.field { display: grid; gap: 6px; }
.field label { font-weight: 700; font-size: .92rem; color: var(--ink); }
.field input[type="text"], .field input[type="email"], .field input[type="tel"], .field select, .field textarea {
  width: 100%; font: inherit; font-size: 1rem; color: var(--ink); background: var(--bg);
  border: 1.5px solid var(--border); border-radius: 10px; padding: 12px 14px; transition: border-color .2s, box-shadow .2s;
}
.field textarea { resize: vertical; min-height: 130px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.field .err { color: #d93025; font-weight: 600; min-height: 0; }
.field .err:empty { display: none; }
.field.invalid input, .field.invalid textarea { border-color: #d93025; }
.consent label { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; font-size: .88rem; color: var(--muted); }
.consent input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--primary); flex-shrink: 0; }
.captcha-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.captcha-img { border-radius: 10px; border: 1.5px solid var(--border); width: 220px; height: 70px; background: #f4efe8; }
.captcha-refresh {
  width: 46px; height: 46px; display: grid; place-items: center; border-radius: 10px; cursor: pointer;
  border: 1.5px solid var(--border); background: var(--bg); color: var(--ink);
}
.captcha-refresh:hover { color: var(--primary); border-color: var(--primary); }
.captcha-refresh.spin svg { animation: spin .5s linear; }
@keyframes spin { to { transform: rotate(360deg); } }
.captcha-row input { flex: 1 1 140px; width: auto !important; text-transform: uppercase; letter-spacing: .3em; font-weight: 800 !important; }
.hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.form-status:empty { display: none; }
.form-status { padding: 14px 16px; border-radius: 10px; font-weight: 600; }
.form-status.ok { background: #e6f4ea; color: #1e6b34; border: 1px solid #b7dfc2; }
.form-status.error { background: #fdecea; color: #a5281b; border: 1px solid #f5c2bd; }
.contact-form button[disabled] { opacity: .65; cursor: wait; }

/* ---------- Pied de page ---------- */
.site-footer { background: var(--footer); color: rgba(255, 255, 255, .75); padding: 48px 0 20px; font-size: .95rem; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 32px; flex-wrap: wrap; }
.footer-brand { display: flex; gap: 16px; align-items: center; }
.footer-brand .brand-logo { width: 64px; background: #fff; border-radius: 12px; padding: 6px 8px; }
.footer-brand p { margin: 0; }
.footer-brand strong { color: #fff; }
.footer-nav { display: flex; gap: 22px; flex-wrap: wrap; }
.footer-nav a, .footer-nav .link { color: rgba(255, 255, 255, .8); text-decoration: none; }
.footer-nav a:hover, .footer-nav .link:hover { color: #fff; text-decoration: underline; }
.copyright { margin-top: 32px; padding-top: 20px; border-top: 1px solid rgba(255, 255, 255, .1); font-size: .85rem; color: rgba(255, 255, 255, .5); }

/* ---------- Mentions légales / visionneuse ---------- */
.legal {
  width: min(720px, calc(100% - 32px)); max-height: 85vh; border: 0; border-radius: 18px; padding: 36px 32px;
  background: var(--card); color: var(--text); box-shadow: 0 30px 80px rgba(0, 0, 0, .4);
}
.legal::backdrop { background: rgba(10, 12, 15, .6); }
.legal h3 { margin-top: 1.4em; font-size: 1.05rem; color: var(--primary); }
.dialog-close {
  position: absolute; top: 12px; right: 14px; width: 40px; height: 40px; border-radius: 50%; border: 0;
  background: var(--surface); color: var(--ink); font-size: 1.6rem; line-height: 1; cursor: pointer;
}
.lightbox-overlay {
  position: fixed; inset: 0; z-index: 100; background: rgba(10, 12, 15, .9);
  display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; color: #fff;
}
.lightbox-overlay[hidden] { display: none; }
.lightbox-overlay img { max-height: 80vh; max-width: 100%; border-radius: 12px; }
.lightbox-overlay p { margin-top: 12px; }

/* Bouton d'appel flottant (mobile) */
.call-fab {
  position: fixed; right: 16px; bottom: 16px; z-index: 40; width: 58px; height: 58px; border-radius: 50%;
  display: none; place-items: center; background: var(--primary); color: var(--on-primary); box-shadow: 0 10px 25px rgba(0, 0, 0, .3);
}
.call-fab svg { width: 26px; height: 26px; }
@media (max-width: 920px) { .call-fab { display: grid; } }

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