/* Configurateur de coque — s'appuie sur les variables de style.css */
.cfg-hero { padding-bottom: 0; }
.cfg-workspace { display: grid; grid-template-columns: minmax(320px, .9fr) minmax(340px, 1.1fr); gap: 22px; align-items: start; }

.cfg-preview, .cfg-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}
.cfg-preview { padding: 24px; position: sticky; top: 96px; overflow: hidden; }
.cfg-preview::before {
  content: ""; position: absolute; width: 320px; height: 320px; border-radius: 50%;
  background: var(--blue); filter: blur(120px); opacity: .14; top: 12%; left: 10%; pointer-events: none;
}
.cfg-preview-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; position: relative; }
.cfg-kicker { text-transform: uppercase; letter-spacing: .16em; font-size: .74rem; font-weight: 800; color: var(--blue-2); }
.cfg-preview-head strong { font-size: 1.05rem; }

.cfg-stage { display: grid; place-items: center; min-height: 420px; padding: 18px 0; position: relative; isolation: isolate; }
.cfg-stage::after {
  content: ""; position: absolute; width: 60%; height: 34px; background: #000; filter: blur(22px);
  opacity: .6; border-radius: 50%; bottom: 4%; z-index: -1;
}
.cfg-phone { width: auto; height: min(440px, 62vh); max-width: 100%; filter: drop-shadow(0 22px 35px rgba(0,0,0,.6)); transform: rotate(-4deg); transition: transform .35s ease; }
.cfg-phone:not(.has-image):hover { transform: rotate(-1deg) translateY(-5px); }
.cfg-phone.has-image { touch-action: none; cursor: grab; }
.cfg-phone.has-image:active { cursor: grabbing; }

.cfg-outer { stroke: rgba(255,255,255,.22); stroke-width: .35; }
.cfg-edge { fill: none; stroke-width: 1.4; stroke-linejoin: round; pointer-events: none; }
.cfg-plate { stroke: rgba(255,255,255,.12); stroke-width: .1; }
.cfg-plate.is-glow { filter: url(#cfgGlow); }
.cfg-matte { pointer-events: none; }
.cfg-lens { fill: #07080b; stroke: none; }
.cfg-cam { fill: none; stroke-linejoin: round; }

.cfg-note { position: relative; margin: 0 0 14px; font-size: .86rem; color: var(--muted); line-height: 1.5; }
.cfg-summary { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; position: relative; }
.cfg-sum { background: rgba(0,0,0,.25); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 9px 12px; min-width: 0; }
.cfg-sum:first-child { grid-column: 1 / -1; }
.cfg-sum span { display: block; color: var(--muted); font-size: .72rem; }
.cfg-sum strong { font-size: .86rem; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cfg-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; margin-right: 7px; border: 1px solid rgba(255,255,255,.35); vertical-align: 0; }

.cfg-panel { padding: 8px 24px 24px; }
.cfg-step { padding: 20px 0; border-bottom: 1px solid var(--line); }
.cfg-step-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.cfg-step-title { display: flex; align-items: center; gap: 10px; font-weight: 750; font-size: 1.05rem; margin-bottom: 14px; }
.cfg-step-head .cfg-step-title { margin-bottom: 14px; }
.cfg-step-title > span {
  width: 28px; height: 28px; flex: none; border-radius: 50%; display: grid; place-items: center;
  font-size: .85rem; background: rgba(33,135,255,.16); color: var(--blue-2); border: 1px solid var(--line-blue);
}
.cfg-step-title em { font-style: normal; font-weight: 500; color: var(--muted); font-size: .88rem; }
.cfg-help { display: block; color: var(--muted); font-size: .86rem; line-height: 1.5; margin-top: 9px; }

.cfg-select { position: relative; }
.cfg-select::after {
  content: ""; position: absolute; right: 16px; top: 50%; width: 8px; height: 8px; margin-top: -6px;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); pointer-events: none;
}
.cfg-select select {
  width: 100%; appearance: none; -webkit-appearance: none; font: inherit; font-size: 1rem; color: var(--text);
  background: var(--surface-soft); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 13px 44px 13px 14px; cursor: pointer;
}
.cfg-select select:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(33,135,255,.25); }
.cfg-select option, .cfg-select optgroup { background: var(--surface-solid); color: var(--text); }

.cfg-reset { color: var(--muted); background: transparent; border: 0; cursor: pointer; padding: 6px 8px; border-radius: 8px; font: inherit; font-size: .86rem; margin-bottom: 14px; }
.cfg-reset:hover { color: var(--text); background: var(--surface-soft); }

.cfg-tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; background: rgba(0,0,0,.3); border: 1px solid var(--line); padding: 5px; border-radius: 15px; margin-bottom: 18px; }
.cfg-tab { border: 0; color: var(--muted); background: transparent; padding: 10px 4px; border-radius: 10px; font: inherit; font-size: .82rem; cursor: pointer; transition: .2s; }
.cfg-tab svg { display: block; margin: 0 auto 4px; width: 19px; height: 19px; }
.cfg-tab.is-active { background: var(--surface-soft); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-blue); }
.cfg-choice-title { font-size: .76rem; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; margin-bottom: 12px; }

.cfg-swatches { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; }
.cfg-swatch {
  min-height: 76px; border: 1px solid var(--line); background: rgba(0,0,0,.22); border-radius: var(--radius-sm); color: var(--text);
  padding: 9px 6px 8px; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px;
  text-align: center; font: inherit; font-size: .74rem; line-height: 1.15; transition: .18s;
}
.cfg-swatch:hover { transform: translateY(-2px); border-color: rgba(255,255,255,.28); }
.cfg-swatch.is-active { border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue), 0 0 24px rgba(33,135,255,.18); }
.cfg-swatch i { width: 30px; height: 30px; border-radius: 50%; background: var(--c); border: 1px solid rgba(255,255,255,.22); }

.cfg-drop {
  display: block; width: 100%; padding: 20px 12px; border: 1px dashed rgba(255,255,255,.3); border-radius: var(--radius-sm);
  background: rgba(0,0,0,.22); color: var(--text); cursor: pointer; font: inherit; text-align: center; transition: .2s;
}
.cfg-drop:hover, .cfg-drop.is-over { border-color: var(--blue); background: rgba(33,135,255,.1); }

.cfg-quality { margin: 12px 0 0; padding: 10px 12px 10px 38px; border-radius: 12px; font-size: .88rem; line-height: 1.45; position: relative; border: 1px solid; }
.cfg-quality::before { position: absolute; left: 13px; top: 9px; font-weight: 800; }
.cfg-quality.is-good { color: var(--success); background: rgba(85,230,165,.08); border-color: rgba(85,230,165,.3); }
.cfg-quality.is-good::before { content: "✓"; }
.cfg-quality.is-ok { color: #ffd166; background: rgba(255,209,102,.08); border-color: rgba(255,209,102,.3); }
.cfg-quality.is-ok::before { content: "!"; }
.cfg-quality.is-bad { color: var(--danger); background: rgba(255,107,122,.08); border-color: rgba(255,107,122,.35); }
.cfg-quality.is-bad::before { content: "✕"; }

.cfg-image-controls label { display: grid; grid-template-columns: 110px 1fr; align-items: center; gap: 8px; margin: 12px 0; font-size: .88rem; }
.cfg-image-controls input { width: 100%; accent-color: var(--blue); }
.cfg-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }

.cfg-actions { display: flex; gap: 10px; margin-top: 22px; flex-wrap: wrap; }
.cfg-actions .btn { flex: 1; justify-content: center; }

.cfg-toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); padding: 12px 18px; background: var(--text); color: #0b0f16;
  border-radius: 999px; font-weight: 700; font-size: .88rem; opacity: 0; pointer-events: none; transition: .25s; box-shadow: 0 15px 50px rgba(0,0,0,.4); z-index: 60;
}
.cfg-toast.is-shown { opacity: 1; transform: translate(-50%, 0); }

[hidden] { display: none !important; }

@media (max-width: 900px) {
  .cfg-workspace { grid-template-columns: 1fr; }
  .cfg-preview { position: relative; top: 0; }
  .cfg-stage { min-height: 340px; }
  .cfg-phone { height: min(340px, 48vh); }
}
@media (max-width: 520px) {
  .cfg-preview { padding: 18px; }
  .cfg-panel { padding: 4px 16px 18px; }
  .cfg-swatches { grid-template-columns: repeat(3, 1fr); }
  .cfg-tab { font-size: .76rem; }
  .cfg-image-controls label { grid-template-columns: 92px 1fr; }
}
