@font-face{
  font-family:"Outfit";
  src:url("./assets/outfit.ttf") format("truetype");
  font-weight:400;
  font-style:normal;
  font-display:swap;
}

:root{
  --bg:#f6f8fb;
  --card:#fff;
  --text:#0f172a;
  --muted:#475569;
  --brand:#ffed00;
  --accent:#eaf3ff;
  --danger-bg:#ffecd6;
  --danger-text:#7a3b00;
  --border:#e5e7eb;
  --gap:24px;
  --ok:#075e00;
  --err:#b91c1c;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family:"Outfit", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color:var(--text);
  background:var(--bg);
}

/* header */
.hero{padding:24px 16px 0}
.hero-inner{
  max-width:1180px; margin:0 auto; background:var(--brand); color:#000;
  border-radius:16px; padding:24px 32px;
}
.hero h1{margin:0; font-size:28px; font-weight:600;text-transform:uppercase;}

/* layout */
.layout{
  max-width:1180px; margin:24px auto; padding:0 16px;
  display:grid; gap:var(--gap);
  grid-template-columns:1fr 1fr;
  grid-template-areas:
    "client article"
    "preview article"
    "cart cart";
  align-items:start;
}

.card{
  background:var(--card); border:1px solid var(--border); border-radius:16px;
  padding:18px; box-shadow:0 1px 2px rgba(0,0,0,.04);
}
.card h2{margin:0 0 12px; font-size:18px; font-weight:600}

.client{ grid-area: client; }
.preview{ grid-area: preview; }
.article{ grid-area: article; display:flex; flex-direction:column }
.cart{ grid-area: cart; }

/* grids */
.grid-3{
  display:grid; grid-template-columns:1fr 1fr 1fr; gap:12px; margin-bottom:12px;
}
.grid-2{
  display:grid; grid-template-columns:1fr 1fr; gap:12px; margin-bottom:12px;
}
.client-grid{
  display:grid; grid-template-columns:1fr 1fr; gap:12px;
}
.grid-1{
  display:grid; grid-template-columns:1fr; margin-bottom:12px;
}

label{display:flex; flex-direction:column; gap:6px; font-size:14px}

input,select,textarea{
  width:100%; padding:10px 12px; font:inherit;
  border:1px solid var(--border); border-radius:10px; background:#fff; outline:none;
}
input:focus,select:focus,textarea:focus{
  border-color:var(--brand);
  box-shadow:0 0 0 3px var(--accent)
}

/* info tiles */
.info-tile{
  border:1px solid var(--border); border-radius:10px;
  padding:10px 12px; background:#fff; color:var(--muted);
}

/* actions */
.actions{display:flex; gap:12px; flex-wrap:wrap; margin-top:12px; align-items:center}
button{
  appearance:none; border:1px solid var(--brand); background:var(--brand);
  color:#000; border-radius:10px; padding:10px 16px; font:inherit; cursor:pointer;
}
button:hover{filter:brightness(.95)}
button.ghost{background:#fff; color:#000;border-color:#000;}
.spacer{flex:1}

/* total */
.total-row{margin-top:12px; display:flex; align-items:center; gap:12px; flex-wrap:wrap;}
.total{color:#000; font-weight:700;text-transform:uppercase; font-size:14px;}
.badge{background:var(--danger-bg); color:var(--danger-text); border-radius:8px; padding:6px 10px}
.hidden{display:none}

/* ================================ */
/*            APERÇU               */
/* ================================ */
#chainLeft,
#chainCenter,
#chainRight {
  display: none !important;
}

/* Cadre 100% stable */
.preview-visual {
  width: 100%;
  height: 240px;
  min-height: 240px;
  max-height: 240px;
  border: 1px solid #ddd;
  background: #fff;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  padding: 0;
}

#previewImage {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* cart */
.cart-actions{
  display:flex; gap:12px; margin-top:16px; flex-wrap:wrap;
}
.cart-actions.centered{justify-content:center;}

.cart-table{
  width:100%;
  border-collapse:collapse;
  font-size:13px;
}
.cart-table th,
.cart-table td{
  padding:6px 8px;
  border-bottom:1px solid var(--border);
  text-align:left;
}
.cart-table th{
  background:#f9fafb;
  font-weight:600;
}
.cart-table .num{
  text-align:right;
}
.cart-remove{
  border:1px solid #ef4444;
  background:#fee2e2;
  color:#991b1b;
  font-size:12px;
  padding:4px 8px;
  border-radius:8px;
}
.cart-total{
  margin-top:10px;
  font-size:14px;
  font-weight:600;
  text-align:right;
}

/* admin */
.adm-block {
  font-size:14px; background:#f9fafb; border-radius:8px;
  padding:12px 16px; border:1px solid #e5e7eb;
}
.adm-total{font-size:16px; font-weight:600; margin-bottom:6px;}
.adm-sep{color:#9ca3af; font-size:13px; text-align:center; margin:4px 0 8px;}
.adm-line{display:flex; justify-content:space-between; padding:2px 0; border-bottom:1px dotted #ddd;}
.adm-totalus{color:#065f46; background:#ecfdf5; border-radius:6px; padding:6px 8px; margin-top:8px; text-align:right;}

@media (max-width:980px){
  .layout{
    grid-template-columns:1fr;
    grid-template-areas:
      "client"
      "preview"
      "article"
      "cart";
    align-items:start;
  }
  .grid-3{grid-template-columns:1fr}
  .grid-2{grid-template-columns:1fr}
  .client-grid{grid-template-columns:1fr}
}

/* ================================ */
/*      TOGGLE iPHONE PREMIUM       */
/* ================================ */

.toggle-wrapper{
  display:flex; align-items:center; justify-content:center;
  gap:10px; margin-top:4px;
}

.toggle-label{
  font-size:12px; color:var(--muted); user-select:none;
  transition:color .18s ease, font-weight .18s ease, opacity .18s ease;
}

.toggle{
  position:relative; width:56px; height:30px; border-radius:999px;
  cursor:pointer; background:#d1d5db; transition:background .22s ease;
  border:1px solid #cbd5e1;
}

.toggle::before{
  content:""; position:absolute; top:-6px; left:-6px;
  width:68px; height:42px; border-radius:999px;
  background:rgba(34,197,94,0.18);
  opacity:0; transform:scale(0.5);
  transition:opacity .25s ease, transform .25s ease;
  pointer-events:none;
}

.toggle .toggle-thumb{
  position:absolute; top:3px; left:3px;
  width:24px; height:24px; border-radius:999px;
  background:#fff; box-shadow:0 2px 4px rgba(0,0,0,.25);
  transition:transform .22s ease, box-shadow .15s ease;
}

.toggle.mode-length{
  background:#4ade80; border-color:#22c55e;
}
.toggle.mode-length .toggle-thumb{
  transform:translateX(26px);
  box-shadow:0 2px 6px rgba(0,0,0,.35);
}
.toggle.mode-length::before{
  opacity:1; transform:scale(1);
}

input[disabled]{
  background:#f3f4f6;
  color:#9ca3af;
  cursor:not-allowed;
}

@media (hover:hover){
  .toggle:hover .toggle-thumb{
    box-shadow:0 2px 6px rgba(0,0,0,.35);
  }
}

.toggle-label{opacity:0.6;}
.label-left-active,
.label-right-active{
  color:#0f172a !important;
  opacity:1 !important;
  font-weight:600;
}
