/* Configurateur (back-office agence) */
body { background: var(--bg-soft); }
.cfg-top { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; }
.cfg-top-in { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; }
.brand { font-family: var(--font-heading); font-size: 1.2rem; color: var(--accent-deep); }

.cfg-layout { display: grid; grid-template-columns: 1fr 380px; gap: 24px; max-width: 1180px; margin: 24px auto; padding: 0 18px; align-items: start; }
.cfg-form { min-width: 0; }
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 18px; }
.step { padding: 22px; }
.step h3 { font-size: 1.05rem; }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 140px; }

/* Templates */
.template-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tpl-card { border: 2px solid var(--border); border-radius: 12px; padding: 12px; cursor: pointer; text-align: center; transition: border-color .15s; }
.tpl-card[aria-pressed="true"] { border-color: var(--accent); }
.tpl-swatch { height: 46px; border-radius: 8px; margin-bottom: 8px; display: flex; overflow: hidden; }
.tpl-swatch span { flex: 1; }
.tpl-name { font-weight: 600; font-size: .82rem; }
.tpl-desc { font-size: .72rem; color: var(--ink-soft); margin-top: 2px; }

.accent-row, #options-row { display: flex; flex-wrap: wrap; gap: 10px; }
.accent-dot { width: 32px; height: 32px; border-radius: 50%; cursor: pointer; border: 2px solid transparent; }
.accent-dot[aria-pressed="true"] { border-color: var(--ink); box-shadow: 0 0 0 2px var(--bg); }

/* Défis */
.chk { display: flex; align-items: center; gap: 10px; padding: 7px 0; font-size: .92rem; border-bottom: 1px solid var(--border); }
.chk input { width: auto; }
.cat-head { font-weight: 600; margin: 14px 0 4px; font-size: .85rem; color: var(--accent-deep); text-transform: uppercase; letter-spacing: .05em; }
.custom-list { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-direction: column; gap: 6px; }
.custom-list li { display: flex; justify-content: space-between; align-items: center; background: var(--bg-soft); padding: 8px 12px; border-radius: 8px; font-size: .9rem; }
.custom-list button { border: 0; background: none; cursor: pointer; color: #b3261e; font-size: 1rem; }
.switch { display: flex; align-items: center; gap: 8px; font-weight: 400; }
.switch input { width: auto; }

/* Formule + options */
.formula-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.formula-card { border: 2px solid var(--border); border-radius: 12px; padding: 14px; cursor: pointer; }
.formula-card[aria-pressed="true"] { border-color: var(--accent); background: var(--bg-soft); }
.formula-card .price { font-family: var(--font-heading); font-size: 1.3rem; color: var(--accent-deep); }
.formula-card .fname { font-weight: 600; }
.formula-card .fdesc { font-size: .74rem; color: var(--ink-soft); margin-top: 4px; }
.opt { display: flex; align-items: center; gap: 10px; padding: 6px 0; font-size: .9rem; }
.opt input { width: auto; }
.opt .opt-price { margin-left: auto; color: var(--accent-deep); font-weight: 600; }

/* Devis */
.quote { background: var(--bg-soft); border-radius: 12px; padding: 16px; margin: 14px 0; }
.quote .line { display: flex; justify-content: space-between; padding: 4px 0; font-size: .92rem; }
.quote .total { border-top: 1px solid var(--border); margin-top: 8px; padding-top: 10px; font-weight: 700; font-size: 1.1rem; }

/* Aperçu */
.cfg-preview { position: relative; }
.preview-sticky { position: sticky; top: 90px; }
.phone { background: #111; border-radius: 36px; padding: 12px; box-shadow: var(--shadow); }
.phone iframe { width: 100%; height: 620px; border: 0; border-radius: 26px; background: #fff; display: block; }

/* ── V2 : porte d'entrée pro ── */
.gate { display: grid; place-items: center; padding: 60px 18px; }
.gate-card { max-width: 460px; width: 100%; padding: 32px; }
.gate-card h2 { color: var(--accent-deep); }

/* ── V2 : formules détaillées ── */
.formula-card { position: relative; display: flex; flex-direction: column; }
.formula-card.is-popular { border-color: var(--accent); }
.formula-card .pc-badge { position: absolute; top: -11px; left: 50%; transform: translateX(-50%);
  background: var(--accent); color: #fff; font-size: .68rem; padding: 3px 11px; border-radius: 999px; font-weight: 600; }
.flist { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-direction: column; gap: 5px; }
.flist li { font-size: .76rem; color: var(--ink-soft); padding-left: 16px; position: relative; }
.flist li::before { content: '✦'; position: absolute; left: 0; color: var(--accent); }
.chip-free { display: inline-block; font-size: .68rem; padding: 2px 8px; border-radius: 999px;
  background: var(--bg-soft); color: var(--accent-deep); border: 1px solid var(--border); margin-left: 6px; }
.price-hint { white-space: nowrap; }

/* ── V2 : catalogue QR physique ── */
.qr-mode { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.qr-cat { margin-bottom: 20px; }
.qr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin-top: 8px; }
.qr-card { border: 2px solid var(--border); border-radius: 12px; padding: 12px; transition: border-color .15s; }
.qr-card.is-selected { border-color: var(--accent); background: var(--bg-soft); }
.qr-thumb { aspect-ratio: 4/3; border-radius: 8px; overflow: hidden; background: var(--bg-soft);
  display: grid; place-items: center; margin-bottom: 8px; }
.qr-thumb img { width: 100%; height: 100%; object-fit: cover; }
.qr-noimg { font-size: .74rem; color: var(--ink-soft); }
.qr-name { font-weight: 600; font-size: .88rem; }
.qr-desc { margin: 2px 0 6px; }
.qr-price { font-weight: 600; color: var(--accent-deep); font-size: .84rem; margin-bottom: 8px; }
.qr-actions { display: flex; gap: 6px; align-items: center; }
.qr-qty { width: 68px; padding: 7px 8px; font-size: .85rem; }
.qr-toggle { padding: 8px 12px; font-size: .82rem; flex: 1; }

/* ── V2 : modale Sur mesure ── */
.modal { position: fixed; inset: 0; background: rgba(20,15,10,.55); display: grid; place-items: center; padding: 16px; z-index: 50; }
.modal-card { width: min(520px, 100%); max-height: 92vh; overflow: auto; padding: 26px; position: relative; }
.modal-close { position: absolute; top: 12px; right: 14px; border: 0; background: transparent; font-size: 1.2rem; cursor: pointer; color: var(--ink-soft); }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 999px; z-index: 80; font-size: .9rem; }
.toast.err { background: #b3261e; }

@media (max-width: 900px) {
  .cfg-layout { grid-template-columns: 1fr; }
  .cfg-preview { order: -1; }
  .preview-sticky { position: static; }
  .phone iframe { height: 460px; }
  .template-grid, .formula-row { grid-template-columns: 1fr; }
}
