/* ============================================================
 *  Choix de l'apparence des panels (inc/panel_design.php)
 *  Toujours chargée, dans l'ancienne comme dans la nouvelle apparence :
 *  la fenêtre et le lien de bascule doivent avoir la même tête partout.
 * ============================================================ */

.pnl-dsg-form { margin: 0; }

/* ---------- Voile et fenêtre ---------- */
.pnl-dsg-veil {
  position: fixed; inset: 0; z-index: 3000; display: grid; place-items: center; padding: 16px;
  background: rgba(21, 34, 61, .55); overflow-y: auto;
}
.pnl-dsg {
  width: min(640px, 100%); padding: 32px; border-radius: 12px; background: #fff; color: #1A1F2B;
  box-shadow: 0 24px 60px rgba(21, 34, 61, .35); font-family: Inter, system-ui, sans-serif;
  animation: pnlDsgIn .2s ease-out both;
}
@keyframes pnlDsgIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .pnl-dsg { animation: none; } }
.pnl-dsg-kicker { margin: 0 0 8px; color: #9C6F2A; font-size: .85rem; font-weight: 500; }
.pnl-dsg h2 { margin: 0 0 8px; font-family: Fraunces, Georgia, serif; font-size: 1.6rem; font-weight: 600; line-height: 1.2; color: #15223D; }
.pnl-dsg-lead { margin: 0 0 24px; color: #5E6470; font-size: .95rem; line-height: 1.55; }
.pnl-dsg-foot { margin: 20px 0 0; color: #848995; font-size: .82rem; text-align: center; }

/* ---------- Deux options côte à côte ---------- */
.pnl-dsg-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.pnl-dsg-opt {
  display: flex; flex-direction: column; gap: 4px; padding: 16px; border-radius: 12px;
  border: 1px solid #E2DCCF; background: #FAF8F3;
}
.pnl-dsg-opt.is-on { border-color: #C8973F; box-shadow: inset 0 0 0 1px #C8973F; background: #fff; }
.pnl-dsg-opt b { margin-top: 12px; font-size: .98rem; font-weight: 600; color: #15223D; }
.pnl-dsg-opt > span:not(.pnl-dsg-mini) { color: #5E6470; font-size: .82rem; }
.pnl-dsg-opt .pnl-dsg-form { margin-top: 16px; }

/* ---------- Boutons ---------- */
.pnl-dsg-btn {
  width: 100%; min-height: 40px; padding: 8px 16px; border-radius: 8px; cursor: pointer;
  font: 600 .9rem/1.2 Inter, system-ui, sans-serif;
  border: 1px solid #D6CEBE; background: #fff; color: #15223D;
  transition: background-color .15s, border-color .15s, color .15s;
}
.pnl-dsg-btn:hover { background: #F4F1EA; }
.pnl-dsg-btn.is-primary { background: #15223D; border-color: #15223D; color: #fff; }
.pnl-dsg-btn.is-primary:hover { background: #2A3B5E; border-color: #2A3B5E; }
.pnl-dsg-btn:focus-visible, .pnl-dsg-switch:focus-visible { outline: 2px solid #C8973F; outline-offset: 2px; }

/* ---------- Vignettes : un panel dessiné en miniature ---------- */
.pnl-dsg-mini {
  position: relative; display: block; height: 112px; border-radius: 8px; overflow: hidden;
  border: 1px solid #E2DCCF; background: #F3F0E8;
}
.pnl-dsg-mini i { position: absolute; display: block; }
.pnl-dsg-mini .s { left: 0; top: 0; bottom: 0; width: 28%; background: #15223D; }
.pnl-dsg-mini .t { left: 36%; top: 12px; width: 40%; height: 9px; border-radius: 2px; background: #15223D; }
.pnl-dsg-mini .c1, .pnl-dsg-mini .c2, .pnl-dsg-mini .c3 { top: 32px; width: 18%; height: 34px; border-radius: 4px; background: #fff; border: 1px solid #E2DCCF; }
.pnl-dsg-mini .c1 { left: 36%; } .pnl-dsg-mini .c2 { left: 57%; } .pnl-dsg-mini .c3 { left: 78%; background: #15223D; border-color: #15223D; }
.pnl-dsg-mini .r { left: 36%; right: 6%; top: 76px; height: 26px; border-radius: 4px; background: #fff; border: 1px solid #E2DCCF; }
/* le repère laiton (entrée active, plaque du nom) n'existe que dans la nouvelle */
.pnl-dsg-mini.is-nouveau .s::before { content: ""; position: absolute; left: 12%; right: 12%; top: 12px; height: 10px; border-radius: 2px; border: 1px solid #C8973F; }
.pnl-dsg-mini.is-nouveau .s::after { content: ""; position: absolute; left: 0; right: 12%; top: 34px; height: 8px; background: rgba(200, 151, 63, .3); box-shadow: inset 2px 0 0 #C8973F; }
.pnl-dsg-mini.is-nouveau .c3::after { content: ""; position: absolute; left: 6px; bottom: 6px; width: 50%; height: 8px; border-radius: 2px; background: #E9CD92; }
/* l'ancienne : barre en dégradé, cartes arrondies et ombrées */
.pnl-dsg-mini.is-ancien { background: #EFEDE7; }
.pnl-dsg-mini.is-ancien .s { background: #223a5e; }
.pnl-dsg-mini.is-ancien .c1, .pnl-dsg-mini.is-ancien .c2, .pnl-dsg-mini.is-ancien .r { border-radius: 7px; box-shadow: 0 3px 8px rgba(27, 39, 64, .1); border-color: transparent; }
.pnl-dsg-mini.is-ancien .c3 { border-radius: 7px; background: #1d3355; }

/* ---------- Lien de bascule, en bas du menu ---------- */
.pnl-dsg-switch {
  display: block; width: 100%; margin: 4px 0; padding: 8px 12px; border: 0; border-radius: 6px; cursor: pointer;
  background: none; color: #9AA6BC; text-align: left; font: 500 .8rem/1.3 Inter, system-ui, sans-serif;
  text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(200, 151, 63, .5);
}
.pnl-dsg-switch:hover { color: #fff; background: rgba(255, 255, 255, .05); }
.pnl-app.pnl-rail .pnl-side-foot .pnl-dsg-form { display: none; }

@media (max-width: 600px) {
  .pnl-dsg { padding: 24px 20px; }
  .pnl-dsg h2 { font-size: 1.35rem; }
  .pnl-dsg-opts { grid-template-columns: 1fr; }
  .pnl-dsg-mini { height: 88px; }
}

/* Le menu mobile s’ouvre avec le bouton de navigation. Le rail est réservé au bureau. */
@media (max-width: 860px) {
  .pnl-body .pnl-app .pnl-side-foot .pnl-railtoggle,
  .pnl-body .pnl-app .pnl-top .pnl-railtoggle,
  .pnl-body .pnl-app .pnl-side-foot .pnl-dsg-form:has(input[name="panel_design"][value="ancien"]) {
    display: none;
  }
}
