/* ==== Configurateur public — design "atelier" ==== */
:root {
  --accent: #8E2138;
  --radius: 10px;
  --ink: #1c211f;
  --muted: #67706c;
  --line: #e3e7e5;
  --bg: #f6f7f6;
  --panel: #ffffff;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  font-size: 16px;
}
body.is-embed { background: transparent; }
h1, h2, h3, .step-title { font-family: 'Archivo', 'Inter', sans-serif; letter-spacing: -0.01em; }
img { max-width: 100%; }

.pub-wrap { max-width: 1080px; margin: 0 auto; padding: 2rem 1.2rem 5rem; }
.pub-hero { padding: 3rem 0 2rem; }
.pub-hero h1 { font-size: clamp(1.9rem, 4.5vw, 3rem); margin: 0.2rem 0 0.5rem; font-weight: 800; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.75rem; font-weight: 600; color: var(--accent); margin: 0; }
.lead { color: var(--muted); max-width: 60ch; }

.cfg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.2rem; }
.cfg-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; text-decoration: none; color: inherit; transition: transform 0.15s, box-shadow 0.15s; display: flex; flex-direction: column; }
.cfg-card:hover { transform: translateY(-3px); box-shadow: 0 12px 30px rgba(0,0,0,0.08); }
.cfg-card img, .cfg-card-ph { width: 100%; height: 170px; object-fit: cover; background: linear-gradient(135deg, var(--accent), #1c211f); }
.cfg-card-body { padding: 1.1rem 1.2rem 1.3rem; }
.cfg-card-body h2 { margin: 0 0 0.3rem; font-size: 1.15rem; }
.cfg-card-body p { margin: 0 0 0.8rem; color: var(--muted); font-size: 0.9rem; }
.cfg-card-cta { color: var(--accent); font-weight: 600; font-size: 0.92rem; }

/* ---- Application configurateur ---- */
.cfg-app { max-width: 860px; margin: 0 auto; padding: 1.4rem 1.1rem 9rem; }
.cfg-header { padding: 1.6rem 0 0.6rem; }
.cfg-header h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); margin: 0.2rem 0 0.4rem; font-weight: 800; }

.cfg-progress { display: flex; gap: 0.35rem; overflow-x: auto; padding: 0.8rem 0 1.2rem; scrollbar-width: none; }
.cfg-progress::-webkit-scrollbar { display: none; }
.cfg-progress-step { display: flex; align-items: center; gap: 0.45rem; background: none; border: 0; padding: 0.4rem 0.7rem; border-radius: 99px; cursor: pointer; color: var(--muted); font: 600 0.8rem 'Inter', sans-serif; white-space: nowrap; }
.cfg-progress-step .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--line); flex: none; transition: background 0.2s; }
.cfg-progress-step.done .dot { background: var(--accent); opacity: 0.45; }
.cfg-progress-step.current { background: var(--panel); border: 1px solid var(--line); color: var(--ink); }
.cfg-progress-step.current .dot { background: var(--accent); opacity: 1; }
.cfg-progress-step[data-hidden="1"] { display: none; }

.cfg-step { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.6rem 1.4rem 1.8rem; animation: stepIn 0.25s ease; }
@keyframes stepIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .cfg-step { animation: none; } }
.step-title { margin: 0 0 0.3rem; font-size: 1.35rem; font-weight: 700; }
.step-desc { margin: 0 0 1.2rem; color: var(--muted); }

.question { margin: 1.3rem 0; }
.question[hidden] { display: none; }
.q-label { display: block; font-weight: 600; margin-bottom: 0.45rem; }
.req { color: #c0392b; }
.q-help { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 50%; background: var(--line); color: var(--muted); font-size: 0.72rem; cursor: help; }
.q-desc { margin: -0.2rem 0 0.6rem; color: var(--muted); font-size: 0.9rem; }
.q-img { border-radius: calc(var(--radius) - 4px); margin-bottom: 0.6rem; max-height: 220px; }
.q-content-title { margin: 0.4rem 0; font-size: 1.1rem; }
.q-content-text { color: var(--muted); }
.q-sep { border: 0; border-top: 1px solid var(--line); }
.cfg-alert { padding: 0.8rem 1rem; border-radius: calc(var(--radius) - 4px); font-size: 0.92rem; border: 1px solid; }
.cfg-alert.info { background: #eef4f8; border-color: #cfe0ec; color: #29506b; }
.cfg-alert.warning { background: #fdf6e7; border-color: #f0dfb4; color: #7a5c14; }
.cfg-alert.danger { background: #fdeeee; border-color: #f2caca; color: #8f2727; }

.q-input { width: 100%; padding: 0.68rem 0.85rem; border: 1.5px solid var(--line); border-radius: calc(var(--radius) - 3px); font: inherit; background: #fff; color: var(--ink); transition: border-color 0.15s; }
.q-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent); }
.q-number { display: flex; align-items: center; gap: 0.6rem; max-width: 300px; }
.q-unit { color: var(--muted); font-weight: 600; }
.q-bounds { margin: 0.3rem 0 0; font-size: 0.8rem; color: var(--muted); }
select.q-input { appearance: auto; }
textarea.q-input { resize: vertical; }

.opt-list { display: flex; flex-direction: column; gap: 0.55rem; }
.opt-row { display: flex; align-items: center; gap: 0.75rem; border: 1.5px solid var(--line); border-radius: calc(var(--radius) - 3px); padding: 0.75rem 0.95rem; cursor: pointer; background: #fff; transition: border-color 0.15s, background 0.15s; }
.opt-row:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, #fff); }
.opt-row input { accent-color: var(--accent); width: 18px; height: 18px; flex: none; }
.opt-row-label { flex: 1; font-weight: 500; }
.opt-row-label small { display: block; color: var(--muted); font-weight: 400; }
.opt-price { color: var(--accent); font-weight: 700; font-size: 0.9rem; white-space: nowrap; }
.opt-row.consent { align-items: flex-start; font-size: 0.88rem; }

.opt-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0.7rem; }
.opt-card input { position: absolute; opacity: 0; }
.opt-card { position: relative; cursor: pointer; }
.opt-card-inner { display: flex; flex-direction: column; gap: 0.3rem; border: 1.5px solid var(--line); border-radius: calc(var(--radius) - 3px); padding: 0.7rem; background: #fff; height: 100%; transition: border-color 0.15s, box-shadow 0.15s; }
.opt-card:has(input:checked) .opt-card-inner { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent); }
.opt-card-inner img { width: 100%; height: 96px; object-fit: cover; border-radius: calc(var(--radius) - 6px); }
.opt-card-title { font-weight: 600; font-size: 0.92rem; }
.opt-card-desc { font-size: 0.8rem; color: var(--muted); }

.opt-colors { display: flex; flex-wrap: wrap; gap: 0.8rem; }
.opt-color input { position: absolute; opacity: 0; }
.opt-color { position: relative; cursor: pointer; text-align: center; width: 84px; }
.swatch { display: block; width: 56px; height: 56px; border-radius: 50%; margin: 0 auto 0.35rem; border: 3px solid #fff; box-shadow: 0 0 0 1.5px var(--line); transition: box-shadow 0.15s, transform 0.15s; }
.opt-color:has(input:checked) .swatch { box-shadow: 0 0 0 3px var(--accent); transform: scale(1.06); }
.opt-color-label { font-size: 0.78rem; font-weight: 600; display: block; line-height: 1.25; }
.opt-color-label small { display: block; color: var(--muted); font-weight: 400; }

.q-error { color: #c0392b; font-size: 0.85rem; margin: 0.35rem 0 0; }
.q-error.global { text-align: center; font-weight: 600; }
.question.has-error .q-input, .question.has-error .opt-row { border-color: #c0392b; }

.step-summary { margin-top: 1.4rem; border-top: 1px dashed var(--line); padding-top: 1rem; font-size: 0.9rem; }
.step-summary table { width: 100%; border-collapse: collapse; }
.step-summary td { padding: 0.25rem 0; }
.step-summary td:last-child { text-align: right; font-weight: 600; }

.client-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
.client-grid .question { margin: 0.7rem 0; }
.client-grid .wide { grid-column: 1 / -1; }
@media (max-width: 560px) { .client-grid { grid-template-columns: 1fr; } }

.cfg-nav { display: flex; justify-content: space-between; gap: 1rem; margin-top: 1.4rem; }
.btn-primary-cfg, .btn-ghost-cfg { font: 600 1rem 'Inter', sans-serif; padding: 0.8rem 1.6rem; border-radius: calc(var(--radius) - 2px); cursor: pointer; border: 1.5px solid transparent; transition: filter 0.15s, background 0.15s; text-decoration: none; display: inline-block; }
.btn-primary-cfg { background: var(--accent); color: #fff; margin-left: auto; }
.btn-primary-cfg:hover { filter: brightness(1.08); }
.btn-ghost-cfg { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-ghost-cfg:hover { background: #fff; }
button:focus-visible, .opt-row:focus-within, .q-input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---- Signature : barre de prix vivante ---- */
.price-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; background: color-mix(in srgb, var(--ink) 96%, var(--accent)); color: #fff; box-shadow: 0 -8px 30px rgba(0,0,0,0.18); }
.price-bar-inner { max-width: 860px; margin: 0 auto; padding: 0.7rem 1.1rem; }
.price-totals { display: flex; align-items: baseline; gap: 1.1rem; flex-wrap: wrap; }
.price-label { text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.68rem; font-weight: 700; opacity: 0.65; margin-right: auto; }
.price-ht, .price-vat, .price-ttc { font-size: 0.85rem; opacity: 0.85; }
.price-ttc strong, .price-ht strong { font-family: 'Archivo', sans-serif; font-size: 1.35rem; font-weight: 800; color: #fff; opacity: 1; }
.price-ttc strong { color: color-mix(in srgb, #fff 70%, var(--accent)); }
#pTTC.bump, #pHT.bump { animation: bump 0.3s ease; display: inline-block; }
@keyframes bump { 40% { transform: scale(1.12); } }
.price-detail-toggle { background: none; border: 0; color: #fff; opacity: 0.7; font: 600 0.78rem 'Inter', sans-serif; cursor: pointer; padding: 0 0 0.3rem; }
.price-lines { font-size: 0.85rem; border-bottom: 1px solid rgba(255,255,255,0.15); margin-bottom: 0.5rem; padding-bottom: 0.5rem; max-height: 40vh; overflow: auto; }
.price-lines div { display: flex; justify-content: space-between; gap: 1rem; padding: 0.12rem 0; opacity: 0.9; }

.cfg-success { text-align: center; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 3rem 1.5rem; }
.success-check { width: 64px; height: 64px; margin: 0 auto 1rem; border-radius: 50%; background: var(--accent); color: #fff; font-size: 2rem; display: flex; align-items: center; justify-content: center; }

.recap-table { width: 100%; border-collapse: collapse; }
.recap-table td { padding: 0.45rem 0; border-bottom: 1px solid var(--line); }
.recap-table td:last-child { text-align: right; font-weight: 600; }
.recap-table.price tr.t td { font-weight: 700; }
.recap-table.price tr.grand td { font-family: 'Archivo', sans-serif; font-size: 1.15rem; font-weight: 800; color: var(--accent); border-bottom: 0; }
.q-panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem; margin-bottom: 1.2rem; }
.q-panel-title { margin: 0 0 0.9rem; font-size: 1.1rem; }

@media (max-width: 640px) {
  .cfg-app { padding: 0.8rem 0.7rem 10rem; }
  .cfg-step { padding: 1.2rem 1rem 1.4rem; }
  .cfg-nav { flex-direction: column-reverse; }
  .btn-primary-cfg, .btn-ghost-cfg { width: 100%; text-align: center; margin-left: 0; }
  .price-totals { gap: 0.7rem; }
}
