/* =====================================================================
   TEMPLATE TPI TECH — styles communs à tous les sites.
   Ne pas modifier par client : les réglages sont dans theme.css.
   ===================================================================== */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 88px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.125rem;
  line-height: 1.6;
}
img { display: block; max-width: 100%; height: auto; }
figure { margin: 0; }
a { color: inherit; }
h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  font-stretch: var(--display-stretch, 100%);
  font-variation-settings: var(--display-variation, normal);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0;
  text-wrap: balance;
}
h2 { font-size: clamp(2rem, 4.4vw, 3.1rem); }
h3 { font-size: 1.35rem; line-height: 1.2; letter-spacing: -0.01em; }
p { margin: 0; }
.wrap { width: min(1160px, 100% - 40px); margin-inline: auto; }
.lead { font-size: 1.25rem; color: var(--ink-soft); max-width: 34em; }
.muted { color: var(--ink-soft); }
.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;
}
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; border-radius: 4px; }

/* ---------- Bandeau démonstration ---------- */
.demo-bar {
  background: var(--ink);
  color: var(--paper);
  font-size: 0.95rem;
  text-align: center;
  padding: 8px 16px;
}
.demo-bar a { color: var(--accent); font-weight: 700; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 26px;
  border: 2px solid var(--ink); border-radius: var(--radius-btn);
  background: transparent; color: var(--ink);
  font: 650 1.05rem/1 var(--font-display); letter-spacing: -0.005em; text-decoration: none; cursor: pointer;
  transition: background-color .15s, color .15s;
}
.btn:hover { background: var(--ink); color: var(--paper); }
.btn--accent { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn--accent:hover { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.btn svg { width: 20px; height: 20px; flex: none; }
.btn[disabled] { opacity: .6; cursor: wait; }

/* ---------- En-tête ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--tint);
}
.site-header .wrap { display: flex; align-items: center; gap: 24px; min-height: 76px; }
.brand { font-family: var(--font-display); font-weight: var(--display-weight); font-stretch: var(--display-stretch, 100%); font-variation-settings: var(--display-variation, normal); font-size: 1.35rem; text-decoration: none; letter-spacing: -0.02em; line-height: 1.1; }
.site-nav { display: flex; gap: 22px; margin-left: auto; }
.site-nav a { text-decoration: none; font-weight: 700; font-size: 1rem; }
.site-nav a:hover { text-decoration: underline; text-underline-offset: 4px; }
.site-header .btn { min-height: 44px; padding: 0 20px; font-size: 1rem; }
@media (max-width: 860px) { .site-nav { display: none; } .site-header .btn { margin-left: auto; } }
@media (max-width: 480px) { .site-header .btn span { display: none; } .site-header .btn { padding: 0 14px; } }

/* ---------- Sections ---------- */
.section { padding: clamp(64px, 9vw, 112px) 0; }
.section--tint { background: var(--tint); }
.section--ink { background: var(--ink); color: var(--paper); }
.section--ink .muted, .section--ink .lead { color: color-mix(in srgb, var(--paper) 75%, transparent); }
.section-head { display: grid; gap: 14px; margin-bottom: 40px; max-width: 46rem; }

/* ---------- Héros ---------- */
.hero { padding: clamp(32px, 6vw, 72px) 0 clamp(56px, 8vw, 96px); }
.hero .wrap { display: grid; gap: clamp(32px, 5vw, 64px); align-items: center; grid-template-columns: 1fr; }
@media (min-width: 900px) { .hero .wrap { grid-template-columns: 1.05fr 1fr; } }
.hero h1 { font-size: clamp(2.8rem, 7.2vw, 5.6rem); line-height: .95; letter-spacing: -0.035em; }
.hero-text { display: grid; gap: 24px; justify-items: start; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

.open-status { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1rem; }
.open-status::before { content: ""; width: 12px; height: 12px; border-radius: 50%; background: var(--ink-soft); }
.open-status[data-open="true"]::before { background: var(--ok); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 25%, transparent); }
.open-status:empty { display: none; }

/* ---------- Comparateur avant / après ---------- */
.compare {
  --pos: 50%;
  position: relative; overflow: hidden;
  border-radius: var(--radius-media, var(--radius-lg));
  aspect-ratio: 4 / 5;
  background: var(--tint);
  user-select: none;
}
.compare img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.compare .compare-before { clip-path: inset(0 calc(100% - var(--pos)) 0 0); }
.compare input[type="range"] {
  position: absolute; inset: 0; width: 100%; height: 100%; margin: 0;
  opacity: 0; cursor: ew-resize; z-index: 3;
}
.compare-handle {
  position: absolute; top: 0; bottom: 0; left: var(--pos); z-index: 2;
  width: 3px; margin-left: -1.5px; background: var(--surface);
  pointer-events: none;
}
.compare-handle::after {
  content: ""; position: absolute; top: 50%; left: 50%;
  width: 56px; height: 56px; margin: -28px 0 0 -28px; border-radius: 50%;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2314302a' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 6l-6 6 6 6M15 6l6 6-6 6'/%3E%3C/svg%3E") center / 26px no-repeat;
  box-shadow: 0 4px 18px rgb(0 0 0 / .18);
}
.compare input[type="range"]:focus-visible ~ .compare-handle::after { outline: 3px solid var(--accent); outline-offset: 3px; }
.compare-tag {
  position: absolute; bottom: 16px; z-index: 2; pointer-events: none;
  padding: 6px 14px; border-radius: 999px;
  background: var(--surface); color: var(--ink); font-weight: 700; font-size: .95rem;
}
.compare-tag--before { left: 16px; }
.compare-tag--after { right: 16px; }
.compare-caption { margin-top: 14px; color: var(--ink-soft); font-size: 1rem; }

/* ---------- Prestations et tarifs ---------- */
.prices { background: var(--surface); border-radius: var(--radius-lg); padding: clamp(8px, 2vw, 16px) clamp(16px, 3vw, 36px); }
.prices table { width: 100%; border-collapse: collapse; }
.prices th, .prices td { text-align: left; padding: 20px 12px; border-bottom: 1px solid var(--tint); vertical-align: top; }
.prices tr:last-child td { border-bottom: 0; }
.prices thead th { font-size: .95rem; color: var(--ink-soft); font-weight: 700; padding-top: 16px; padding-bottom: 12px; }
.prices td.price, .prices th.price { text-align: right; white-space: nowrap; font-family: var(--font-display); font-weight: 650; font-size: 1.3rem; }
.prices thead th.price { font-family: var(--font-body); font-size: .95rem; font-weight: 700; }
.prices td p { color: var(--ink-soft); font-size: 1rem; margin-top: 4px; max-width: 30em; }
.prices-note { margin-top: 18px; color: var(--ink-soft); font-size: 1rem; }
@media (max-width: 680px) {
  .prices thead { display: none; }
  .prices tr { display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid var(--tint); padding: 16px 0; }
  .prices tr:last-child { border-bottom: 0; }
  .prices td { border: 0; padding: 4px 6px; }
  .prices td:first-child { grid-column: 1 / -1; padding-bottom: 10px; }
  .prices td.price { text-align: left; font-size: 1.15rem; }
  .prices td.price::before { content: attr(data-label); display: block; font-family: var(--font-body); font-size: .85rem; font-weight: 700; color: var(--ink-soft); }
  .prices td.price[colspan] { grid-column: 1 / -1; }
}

/* ---------- Galerie ---------- */
.gallery { display: grid; gap: 28px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .gallery { grid-template-columns: 1fr 1fr; } }
.gallery .compare { aspect-ratio: 1 / 1; }

/* ---------- Présentation ---------- */
.about { display: grid; gap: clamp(28px, 5vw, 64px); align-items: center; }
@media (min-width: 860px) { .about { grid-template-columns: 1fr 1.1fr; } }
.about img { border-radius: var(--radius-media, var(--radius-lg)); aspect-ratio: 4 / 5; object-fit: cover; width: 100%; background: var(--tint); }
.about-text { display: grid; gap: 20px; }
.about-text ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 12px; }
.about-text li { padding-left: 30px; position: relative; }
.about-text li::before { content: ""; position: absolute; left: 0; top: .55em; width: 14px; height: 14px; border-radius: 50%; background: var(--accent); }

/* ---------- Infos pratiques ---------- */
.infos { display: grid; gap: 40px; }
@media (min-width: 860px) { .infos { grid-template-columns: 1fr 1fr; gap: 64px; } }
.hours { width: 100%; border-collapse: collapse; font-size: 1.1rem; }
.hours th, .hours td { text-align: left; padding: 12px 0; border-bottom: 1px solid color-mix(in srgb, var(--paper) 22%, transparent); }
.hours td { text-align: right; }
.hours tr[data-today="true"] th, .hours tr[data-today="true"] td { color: var(--accent); font-weight: 700; }
.infos address { font-style: normal; font-size: 1.35rem; font-family: var(--font-display); font-weight: 600; line-height: 1.3; margin: 12px 0 24px; }
.infos .btn { border-color: var(--paper); color: var(--paper); }
.infos .btn:hover { background: var(--paper); color: var(--ink); }
.infos .btn--accent { border-color: var(--accent); color: var(--accent-ink); }
.infos h3 { margin-bottom: 12px; }
.infos-block + .infos-block { margin-top: 36px; }

/* ---------- Avis ---------- */
.reviews-empty {
  border: 2px dashed var(--ink-soft); border-radius: var(--radius-lg);
  padding: clamp(28px, 5vw, 48px); display: grid; gap: 10px; max-width: 46rem;
}

/* ---------- Contact ---------- */
.contact { display: grid; gap: clamp(32px, 5vw, 64px); }
@media (min-width: 900px) { .contact { grid-template-columns: .8fr 1.2fr; } }
.contact-aside { display: grid; gap: 20px; align-content: start; }
.contact-aside a { font-weight: 700; }
.form { background: var(--surface); border-radius: var(--radius-lg); padding: clamp(22px, 4vw, 40px); display: grid; gap: 18px; }
.form-row { display: grid; gap: 18px; }
@media (min-width: 640px) { .form-row { grid-template-columns: 1fr 1fr; } }
.field { display: grid; gap: 6px; }
.field label { font-weight: 700; font-size: 1rem; }
.field input, .field textarea, .field select {
  width: 100%; padding: 13px 14px; font: inherit; font-size: 1.05rem; color: var(--ink);
  background: var(--paper); border: 2px solid transparent; border-radius: var(--radius-sm);
}
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--ink); background: var(--surface); }
.field textarea { min-height: 140px; resize: vertical; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.form-legal { font-size: .95rem; color: var(--ink-soft); }
[data-form-status] { font-weight: 700; }
[data-form-status][data-state="ok"] { color: var(--ok); }
[data-form-status][data-state="error"] { color: var(--error); }

/* ---------- Pied de page ---------- */
.site-footer { background: var(--ink); color: var(--paper); padding: 48px 0 40px; font-size: 1rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 20px 40px; justify-content: space-between; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.site-footer a { color: var(--paper); }
.site-footer .credit { opacity: .75; }

/* ---------- Pages simples (mentions légales, confidentialité, 404) ---------- */
.page { padding: clamp(40px, 7vw, 88px) 0; }
.page .wrap { max-width: 46rem; }
.page h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); margin-bottom: 28px; }
.page h2 { font-size: 1.5rem; margin: 36px 0 12px; }
.page p, .page li { margin-bottom: 10px; }
.page ul { padding-left: 1.2em; }

/* ---------- Barre d'appel mobile ---------- */
.call-bar { display: none; }
@media (max-width: 720px) {
  .call-bar {
    display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    background: var(--ink);
  }
  .call-bar .btn { min-height: 50px; padding: 0 12px; border-color: var(--paper); color: var(--paper); }
  .call-bar .btn--accent { border-color: var(--accent); color: var(--accent-ink); }
  body { padding-bottom: 76px; }
}

/* ---------- Message de démonstration ---------- */
.toast {
  position: fixed; left: 50%; bottom: 96px; z-index: 40; transform: translateX(-50%);
  width: min(440px, calc(100% - 32px)); padding: 16px 20px;
  background: var(--ink); color: var(--paper); border-radius: var(--radius-sm);
  box-shadow: 0 10px 30px rgb(0 0 0 / .25); font-size: 1rem;
}
.toast[hidden] { display: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
