
:root {
  --cream: #ffffff;
  --cream-2: oklch(97% 0.008 85);
  --ink: oklch(18% 0.025 250);
  --ink-soft: oklch(40% 0.02 250);
  --ink-mute: oklch(58% 0.015 250);
  --rule: oklch(90% 0.008 85);
  --green-v2: oklch(48% 0.13 152);
  /* charte Aratice */
  --ara-blue: #185FA5;
  --ara-blue-dk: #134d86;
  --ara-blue-soft: #eaf2fb;
}
html, body { background: #ffffff; }
body { color: var(--ink); font-family: 'Plus Jakarta Sans', sans-serif; }

/* ── nav (cohérent site) ── */
.site-nav { background: rgba(255,255,255,0.9) !important; border-bottom: 1px solid var(--rule) !important; }
.nav-logo { color: var(--ink) !important; font-family: 'Bricolage Grotesque', sans-serif; font-weight: 700; letter-spacing: -0.8px; }
.nav-logo span { color: var(--green-v2) !important; }
.nav-links a { color: var(--ink-soft) !important; }
.nav-links a:hover, .nav-links a.active { color: var(--ink) !important; }
.btn-ink {
  background: var(--ink); color: var(--cream); padding: 8px 16px; border-radius: 100px;
  font-size: 13px; font-weight: 600; text-decoration: none; display: inline-flex; align-items: center; gap: 8px;
  border: none; cursor: pointer; transition: transform .2s, background .2s;
}
.btn-ink:hover { background: oklch(28% 0.04 250); transform: translateY(-1px); }
.btn-ink .arrow { font-family: 'Newsreader', serif; font-style: italic; font-size: 16px; }

.display { font-family: 'Bricolage Grotesque', sans-serif; font-variation-settings: "wdth" 95; font-weight: 800; letter-spacing: -0.04em; line-height: 0.95; text-wrap: balance; }
.serif { font-family: 'Newsreader', serif; font-style: italic; font-weight: 400; }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; font-size: 11px; font-weight: 700; letter-spacing: 1.8px; text-transform: uppercase; color: var(--ink-mute); }
.eyebrow::before { content: ''; width: 28px; height: 1px; background: var(--ink-mute); }

/* ── page shell ── */
.cfg-wrap { max-width: 1240px; margin: 0 auto; padding: 116px 24px 80px; }
.cfg-head { margin-bottom: 36px; }
.cfg-head h1 { font-size: clamp(32px, 4.6vw, 52px); margin: 14px 0 14px; }
.cfg-head h1 em { font-family: 'Newsreader', serif; font-style: italic; font-weight: 400; color: var(--ara-blue); }
.cfg-head p { font-size: 17px; color: var(--ink-soft); max-width: 640px; line-height: 1.65; }
.cfg-back { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--ink-mute); text-decoration: none; margin-bottom: 8px; }
.cfg-back:hover { color: var(--ink); }

.cfg-grid { display: grid; grid-template-columns: 380px 1fr; gap: 40px; align-items: start; }

/* ── left controls ── */
.cfg-panel { background: var(--cream-2); border: 1px solid var(--rule); border-radius: 20px; padding: 26px; position: sticky; top: 96px; }
.cfg-step { margin-bottom: 26px; }
.cfg-step:last-child { margin-bottom: 0; }
.cfg-step-h { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.cfg-step-n { width: 24px; height: 24px; border-radius: 50%; background: var(--ara-blue); color: #fff; font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.cfg-step-h h3 { font-size: 14px; font-weight: 700; letter-spacing: -0.2px; }

/* dropzone */
.cfg-drop { border: 2px dashed oklch(80% 0.02 250); border-radius: 14px; background: #fff; padding: 26px 18px; text-align: center; cursor: pointer; transition: border-color .2s, background .2s; }
.cfg-drop:hover, .cfg-drop.drag { border-color: var(--ara-blue); background: var(--ara-blue-soft); }
.cfg-drop .ic { width: 42px; height: 42px; margin: 0 auto 12px; color: var(--ara-blue); }
.cfg-drop b { display: block; font-size: 14px; color: var(--ink); margin-bottom: 4px; }
.cfg-drop span { font-size: 12px; color: var(--ink-mute); line-height: 1.5; }
.cfg-drop-hint { font-size: 11.5px; color: var(--ink-mute); margin-top: 10px; line-height: 1.55; }

/* loaded file chip */
.cfg-file { display: none; align-items: center; gap: 12px; background: #fff; border: 1px solid var(--rule); border-radius: 12px; padding: 10px 12px; margin-top: 12px; }
.cfg-file.show { display: flex; }
.cfg-file-thumb { width: 40px; height: 40px; border-radius: 8px; border: 1px solid var(--rule); background: var(--cream-2) center/contain no-repeat; flex-shrink: 0; }
.cfg-file-meta { flex: 1; min-width: 0; }
.cfg-file-meta b { display: block; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cfg-file-meta span { font-size: 11.5px; color: var(--ink-mute); }
.cfg-file-x { background: none; border: none; color: var(--ink-mute); cursor: pointer; font-size: 18px; line-height: 1; padding: 4px; }
.cfg-file-x:hover { color: var(--terra, #b4452f); }

/* controls disabled until logo */
.cfg-controls { opacity: .4; pointer-events: none; transition: opacity .25s; }
.cfg-controls.on { opacity: 1; pointer-events: auto; }

.cfg-label { display: flex; justify-content: space-between; align-items: baseline; font-size: 12.5px; font-weight: 600; color: var(--ink-soft); margin-bottom: 8px; }
.cfg-label .val { font-variant-numeric: tabular-nums; color: var(--ink-mute); font-weight: 500; }
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 5px; border-radius: 5px; background: oklch(88% 0.01 250); outline: none; margin: 4px 0 2px; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%; background: var(--ara-blue); cursor: pointer; border: 3px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.2); }
input[type=range]::-moz-range-thumb { width: 20px; height: 20px; border-radius: 50%; background: var(--ara-blue); cursor: pointer; border: 3px solid #fff; }

/* color swatches */
.cfg-swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.cfg-swatch { width: 40px; height: 40px; border-radius: 10px; cursor: pointer; border: 2px solid transparent; box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); position: relative; transition: transform .15s; }
.cfg-swatch:hover { transform: scale(1.06); }
.cfg-swatch.active { border-color: var(--ara-blue); box-shadow: 0 0 0 2px #fff inset, 0 2px 6px rgba(0,0,0,.18); }
.cfg-swatch.active::after { content: '✓'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 15px; font-weight: 700; text-shadow: 0 1px 2px rgba(0,0,0,.5); }

/* toggle */
.cfg-toggle { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.cfg-toggle-sw { width: 42px; height: 24px; border-radius: 100px; background: oklch(85% 0.01 250); position: relative; transition: background .2s; flex-shrink: 0; }
.cfg-toggle-sw::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.cfg-toggle input { display: none; }
.cfg-toggle input:checked + .cfg-toggle-sw { background: var(--ara-blue); }
.cfg-toggle input:checked + .cfg-toggle-sw::after { transform: translateX(18px); }
.cfg-toggle-txt b { display: block; font-size: 13px; font-weight: 600; }
.cfg-toggle-txt span { font-size: 11.5px; color: var(--ink-mute); }

.cfg-reset { background: none; border: 1px solid var(--rule); border-radius: 100px; padding: 8px 16px; font-size: 12.5px; font-weight: 600; color: var(--ink-soft); cursor: pointer; display: inline-flex; align-items: center; gap: 7px; transition: background .2s; }
.cfg-reset:hover { background: #fff; }

.cfg-cta { margin-top: 8px; width: 100%; background: var(--ara-blue); color: #fff; border: none; border-radius: 100px; padding: 16px; font-size: 15px; font-weight: 700; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 10px; transition: background .2s, transform .15s; box-shadow: 0 6px 18px rgba(24,95,165,.28); }
.cfg-cta:hover { background: var(--ara-blue-dk); transform: translateY(-1px); }
.cfg-cta:disabled { background: oklch(85% 0.01 250); color: var(--ink-mute); cursor: not-allowed; box-shadow: none; transform: none; }
.cfg-cta-sub { font-size: 11.5px; color: var(--ink-mute); text-align: center; margin-top: 10px; line-height: 1.5; }

/* qty + secondary download */
.cfg-buy { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--rule); }
.cfg-qty-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.cfg-qty-row > span { font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.cfg-qty { display: flex; align-items: center; gap: 0; border: 1.5px solid var(--rule); border-radius: 100px; overflow: hidden; background: #fff; }
.cfg-qty button { width: 38px; height: 38px; border: none; background: #fff; cursor: pointer; font-size: 18px; color: var(--ink); display: flex; align-items: center; justify-content: center; }
.cfg-qty button:hover { background: var(--cream-2); }
.cfg-qty input { width: 52px; height: 38px; border: none; border-left: 1.5px solid var(--rule); border-right: 1.5px solid var(--rule); text-align: center; font-size: 14px; font-weight: 700; font-family: inherit; color: var(--ink); outline: none; -moz-appearance: textfield; }
.cfg-qty input::-webkit-outer-spin-button, .cfg-qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.cfg-add { width: 100%; background: var(--ink); color: #fff; border: none; border-radius: 100px; padding: 16px; font-size: 15px; font-weight: 700; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 9px; transition: background .2s, transform .2s; }
.cfg-add:hover { background: oklch(28% 0.04 250); transform: translateY(-1px); }
.cfg-add:disabled { background: oklch(85% 0.01 250); color: var(--ink-mute); cursor: not-allowed; transform: none; }
.cfg-add .cfg-add-price { font-variant-numeric: tabular-nums; opacity: .85; font-weight: 600; }
.cfg-or { text-align: center; font-size: 12px; color: var(--ink-mute); margin: 12px 0 4px; }

/* ── right preview ── */
.cfg-stage-col { display: flex; flex-direction: column; align-items: center; }
.cfg-viewport { position: relative; width: 100%; max-width: 540px; background: #f5f5f5;
  border: 1px solid var(--rule); border-radius: 24px; padding: 30px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.cfg-pouch { position: relative; width: 330px; max-width: 100%; aspect-ratio: 656 / 695; user-select: none; }
.cfg-pouch #pouchSvg { width: 100%; height: 100%; display: block; }
.cfg-pouch #pouchSvg img { width: 100%; height: 100%; object-fit: contain; display: block; }
/* logo overlay zone — matches the SVG print area */
.cfg-logo-zone { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); cursor: grab; touch-action: none; }
.cfg-logo-zone.dragging { cursor: grabbing; }
.cfg-logo-zone img { display: block; width: 100%; height: auto; object-fit: contain; pointer-events: none; }
.cfg-logo-zone.mono img { filter: brightness(0) invert(1); }
.cfg-logo-frame { position: absolute; inset: -7px; border: 1.5px dashed rgba(255,255,255,.55); border-radius: 6px; opacity: 0; transition: opacity .2s; pointer-events: none; }
.cfg-logo-zone:hover .cfg-logo-frame, .cfg-logo-zone.dragging .cfg-logo-frame { opacity: 1; }
/* placeholder guide when no logo */
.cfg-guide { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); width: 46%; aspect-ratio: 1; border: 2px dashed rgba(255,255,255,.45); border-radius: 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; color: rgba(255,255,255,.72); pointer-events: none; }
.cfg-guide svg { width: 30px; height: 30px; }
.cfg-guide span { font-size: 11.5px; font-weight: 600; letter-spacing: .3px; max-width: 130px; line-height: 1.4; }

.cfg-stage-tools { display: flex; align-items: center; gap: 14px; margin-top: 22px; flex-wrap: wrap; justify-content: center; }
.cfg-face-tabs { display: inline-flex; background: var(--cream-2); border: 1px solid var(--rule); border-radius: 100px; padding: 4px; gap: 4px; }
.cfg-face-tabs button { border: none; background: none; padding: 7px 16px; border-radius: 100px; font-size: 12.5px; font-weight: 600; color: var(--ink-mute); cursor: pointer; }
.cfg-face-tabs button.active { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.1); }
.cfg-hint { font-size: 12px; color: var(--ink-mute); display: inline-flex; align-items: center; gap: 7px; }
.cfg-hint svg { width: 15px; height: 15px; }

.cfg-specs { display: flex; gap: 26px; flex-wrap: wrap; margin-top: 30px; padding-top: 26px; border-top: 1px solid var(--rule); justify-content: center; }
.cfg-spec { text-align: center; }
.cfg-spec b { display: block; font-family: 'Bricolage Grotesque', sans-serif; font-size: 19px; font-weight: 700; }
.cfg-spec span { font-size: 11.5px; color: var(--ink-mute); }

.cfg-toast { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--ink); color: #fff; padding: 13px 22px; border-radius: 100px; font-size: 13.5px; font-weight: 600; box-shadow: 0 10px 30px rgba(0,0,0,.25); opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; z-index: 200; display: flex; align-items: center; gap: 9px; }
.cfg-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 900px) {
  .cfg-grid { grid-template-columns: 1fr; gap: 28px; }
  .cfg-panel { position: static; order: 2; }
  .cfg-stage-col { order: 1; }
}
