/* Charte graphique Altium Bois — reprise de www.altiumbois.fr
   primaire terracotta hsl(8 72% 45%), accent ambre hsl(38 75% 48%),
   charbon vert hsl(150 20% 15%), fonds crème hsl(150 15/20% 94-98%),
   titres Montserrat, texte Open Sans */
:root {
  --primary: hsl(8, 72%, 45%);
  --primary-dark: hsl(8, 72%, 38%);
  --primary-soft: hsla(8, 72%, 45%, 0.1);
  --accent: hsl(38, 75%, 48%);
  --foreground: hsl(150, 25%, 12%);
  --charcoal: hsl(150, 20%, 15%);
  --wood: hsl(150, 45%, 25%);
  --background: hsl(150, 20%, 96%);
  --cream: hsl(150, 15%, 94%);
  --card: hsl(150, 12%, 99%);
  --border: hsl(150, 15%, 88%);
  --muted: hsl(150, 15%, 40%);
  --radius: 12px;
  --shadow: 0 10px 40px hsla(150, 25%, 12%, 0.08);
  --heading: "Montserrat", "Open Sans", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  font-family: "Open Sans", Arial, sans-serif;
  font-size: 15px;
  color: var(--foreground);
  background: var(--background);
  min-height: 100vh;
}

h1, h2, h3 { font-family: var(--heading); font-weight: 700; }

/* ===== Header ===== */
.site-header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: 860px; margin: 0 auto; padding: 12px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.brand { display: flex; align-items: center; text-decoration: none; }
.brand img { height: 52px; width: auto; display: block; }
.header-tag {
  color: var(--primary); font-family: var(--heading); font-weight: 600;
  font-size: 11px; text-transform: uppercase; letter-spacing: .08em;
}

/* ===== Layout ===== */
.wrap { max-width: 860px; margin: 0 auto; padding: 0 20px 60px; }

.hero { text-align: center; padding: 44px 10px 28px; }
.hero .kicker {
  display: block; color: var(--primary); font-family: var(--heading);
  font-weight: 600; font-size: 13px; text-transform: uppercase; letter-spacing: .12em;
  margin-bottom: 12px;
}
.hero h1 { font-size: clamp(28px, 5vw, 38px); line-height: 1.15; color: var(--charcoal); }
.hero h1 em { font-style: normal; color: var(--primary); }
.hero p { max-width: 620px; margin: 14px auto 0; color: var(--muted); line-height: 1.6; }

/* ===== Progress ===== */
.progress { margin: 8px 0 18px; }
.progress-track { height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.progress-fill { height: 100%; width: 0; background: var(--primary); border-radius: 3px; transition: width .35s ease; }
.progress-labels { display: flex; justify-content: space-between; margin-top: 8px; font-size: 11.5px; color: var(--muted); }
.progress-labels span.active { color: var(--primary); font-weight: 700; }

/* ===== Card ===== */
.card {
  background: var(--card); border-radius: 16px; border: 1px solid var(--border);
  box-shadow: var(--shadow); padding: 36px clamp(20px, 5vw, 44px) 30px;
}
.step h2 { font-size: 24px; margin-bottom: 6px; color: var(--charcoal); }
.step-sub { color: var(--muted); margin-bottom: 18px; line-height: 1.55; }

.field-label { display: block; font-family: var(--heading); font-weight: 600; font-size: 13.5px; margin: 22px 0 10px; }
.field-label small { font-family: "Open Sans", sans-serif; font-weight: 400; color: var(--muted); }
.subfield { animation: fadeIn .25s ease; }

/* ===== Choice cards ===== */
.choice-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.roof-grid { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
.choice {
  background: var(--card); border: 1.5px solid var(--border); border-radius: var(--radius);
  padding: 16px 12px 14px; cursor: pointer; text-align: center;
  font-family: inherit; color: var(--foreground);
  transition: border-color .15s, transform .12s, box-shadow .15s;
}
.choice:hover { transform: translateY(-2px); border-color: hsla(8, 72%, 45%, 0.5); box-shadow: 0 4px 14px hsla(150, 25%, 12%, 0.08); }
.choice.selected { border-color: var(--primary); background: #fff; box-shadow: 0 4px 14px hsla(8, 72%, 45%, 0.15); position: relative; }
.choice.selected::after {
  content: "✓"; position: absolute; top: 8px; right: 10px;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--primary); color: #fff;
  font-size: 13px; font-weight: 700; line-height: 20px;
}
.choice svg { width: 64px; height: 48px; margin-bottom: 8px; }
.choice svg .roof { stroke: var(--primary); stroke-width: 3.5; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.choice svg .body { stroke: hsl(150, 15%, 65%); stroke-width: 2.5; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.choice strong { display: block; font-family: var(--heading); font-weight: 600; font-size: 13px; }
.choice small { color: var(--muted); font-size: 11.5px; }

/* ===== Pills ===== */
.pill-row { display: flex; flex-wrap: wrap; gap: 10px; }
.pill {
  border: 1.5px solid var(--border); background: var(--card); color: var(--foreground);
  border-radius: 999px; padding: 10px 18px; font-family: inherit; font-size: 13.5px;
  cursor: pointer; transition: all .15s;
}
.pill small { color: var(--muted); font-size: 11px; }
.pill:hover { border-color: var(--primary); }
.pill.selected { background: var(--primary); color: #fff; border-color: var(--primary); font-weight: 600; }
.pill.selected small { color: hsla(0, 0%, 100%, 0.85); }

/* ===== Inputs ===== */
textarea, input[type="text"], input[type="email"], input[type="tel"], input[type="number"], input[type="password"] {
  width: 100%; border: 1.5px solid var(--border); border-radius: 10px;
  padding: 13px 15px; font-family: inherit; font-size: 15px; color: var(--foreground);
  background: var(--card); transition: border-color .15s, box-shadow .15s;
}
textarea:focus, input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
textarea { resize: vertical; line-height: 1.55; }
.input-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 4px; }
.input-grid .span2 { grid-column: span 2; }
.labeled-input label { display: block; font-family: var(--heading); font-weight: 600; font-size: 12.5px; margin-bottom: 7px; }
.hint { font-size: 12px; color: var(--muted); margin-top: 10px; line-height: 1.5; }
.hint.center { text-align: center; }

/* ===== Slider ===== */
.slider-field { margin-top: 22px; }
input[type="range"] {
  width: 100%; margin-top: 6px; accent-color: var(--primary); height: 6px; cursor: pointer;
}
#penteOut { color: var(--primary); }

/* ===== Counters ===== */
.counter-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 22px; }
.counter { background: var(--cream); border-radius: var(--radius); padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.counter-label { font-size: 13.5px; font-weight: 600; }
.counter-ctrl { display: flex; align-items: center; gap: 12px; }
.counter-ctrl button {
  width: 32px; height: 32px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--primary); color: #fff; font-size: 18px; line-height: 1;
  transition: transform .1s, background .15s;
}
.counter-ctrl button:hover { transform: scale(1.08); background: var(--primary-dark); }
.counter-ctrl output { min-width: 22px; text-align: center; font-weight: 700; font-size: 16px; }

/* ===== Switch ===== */
.switch-row { display: flex; align-items: center; gap: 14px; margin-top: 24px; cursor: pointer; }
.switch-row input { display: none; }
.switch {
  flex: none; width: 46px; height: 26px; border-radius: 13px;
  background: var(--border); position: relative; transition: background .2s;
}
.switch::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px;
  border-radius: 50%; background: #fff; transition: left .2s;
  box-shadow: 0 1px 4px rgba(0,0,0,.25);
}
.switch-row input:checked + .switch { background: var(--primary); }
.switch-row input:checked + .switch::after { left: 23px; }
.switch-label small { color: var(--muted); }

/* ===== Buttons ===== */
.btn {
  font-family: var(--heading); font-size: 14.5px; font-weight: 600;
  border-radius: 10px; padding: 14px 26px; cursor: pointer;
  border: none; transition: all .15s; display: inline-flex; align-items: center; gap: 9px; justify-content: center;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 6px 18px hsla(8, 72%, 45%, 0.3); }
.btn-primary:disabled { opacity: .55; cursor: wait; transform: none; }
.btn-ghost { background: transparent; color: var(--charcoal); border: 1.5px solid var(--border); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }
.btn-full { width: 100%; margin-top: 18px; }
.btn-row { display: flex; gap: 12px; margin-top: 18px; flex-wrap: wrap; }
.btn-ai svg { flex: none; }

.step-nav { display: flex; justify-content: space-between; margin-top: 30px; padding-top: 22px; border-top: 1px solid var(--border); }

.step-error, .ai-error {
  background: hsl(0, 70%, 96%); color: hsl(0, 62%, 40%); border-radius: 10px;
  padding: 12px 16px; font-size: 13.5px; margin-top: 16px;
}
.ai-note { margin-top: 14px; font-size: 13.5px; color: var(--wood); font-weight: 600; }

/* ===== Estimation ===== */
.estimate-loading { text-align: center; padding: 50px 0; color: var(--muted); }
.spinner {
  width: 44px; height: 44px; margin: 0 auto 16px; border-radius: 50%;
  border: 4px solid var(--cream); border-top-color: var(--primary);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.estimate-box {
  background: var(--charcoal); border-radius: 16px; padding: 28px 30px;
  margin-top: 18px; position: relative; overflow: hidden;
}
.estimate-box::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 6px; background: var(--primary); }
.estimate-caption { color: hsl(150, 10%, 78%); font-size: 13px; }
.estimate-amount {
  font-family: var(--heading); color: #fff;
  font-size: clamp(24px, 4.6vw, 34px); font-weight: 700; margin-top: 8px;
}
.estimate-ttc { color: var(--accent); font-size: 15px; margin-top: 8px; font-weight: 600; }
.estimate-factors { margin-top: 16px; list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.estimate-factors li {
  color: hsl(150, 10%, 85%); font-size: 11.5px; background: hsla(0, 0%, 100%, 0.1);
  border-radius: 999px; padding: 4px 12px;
}
.disclaimer { font-size: 12px; color: var(--muted); margin-top: 14px; line-height: 1.55; }

.contact-block { margin-top: 30px; background: var(--cream); border-radius: 16px; padding: 26px clamp(18px, 4vw, 30px); }
.contact-block h3 { font-size: 19px; margin-bottom: 16px; color: var(--charcoal); }
.contact-block input { background: #fff; }

.lead-success { text-align: center; padding: 30px 10px; }
.success-check {
  width: 64px; height: 64px; margin: 0 auto 18px; border-radius: 50%;
  background: var(--primary); color: #fff; font-size: 34px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.lead-success p { color: var(--muted); margin: 12px auto 24px; max-width: 480px; line-height: 1.6; }

/* ===== Footer ===== */
.site-footer { text-align: center; margin-top: 36px; font-size: 12px; color: var(--muted); }
.site-footer a { color: var(--primary); font-weight: 700; text-decoration: none; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.step { animation: fadeIn .3s ease; }

@media (max-width: 560px) {
  .header-tag { display: none; }
  .brand img { height: 42px; }
  .input-grid, .counter-row { grid-template-columns: 1fr; }
  .input-grid .span2 { grid-column: span 1; }
  .card { padding: 26px 18px 22px; }
  .progress-labels span:not(.active) { visibility: hidden; }
}
