/* Fenêtre de confirmation : discrète, lisible, adaptée au téléphone. */
.cfm { width: min(440px, calc(100vw - 2rem)); max-height: calc(100dvh - 2rem); padding: 0; border: 0; border-radius: 22px; background: var(--surface); color: var(--text-primary); box-shadow: 0 24px 60px rgba(15, 23, 42, .28); overflow: hidden; }
.cfm::backdrop { background: rgba(15, 23, 42, .5); backdrop-filter: blur(2px); }
.cfm[open] { animation: cfm-in .22s ease-out; }
.cfm[open]::backdrop { animation: cfm-fade .22s ease-out; }
@keyframes cfm-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes cfm-fade { from { opacity: 0; } to { opacity: 1; } }
.cfm-box { display: grid; gap: .75rem; padding: 1.5rem 1.5rem 1.25rem; text-align: left; }
.cfm-icon { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); }
.cfm-title { margin: 0; font-size: 1.15rem; font-weight: 800; line-height: 1.3; }
.cfm-msg { margin: 0; color: var(--text-secondary); font-size: .97rem; line-height: 1.5; overflow-wrap: anywhere; }
.cfm-actions { display: grid; gap: .5rem; margin-top: .4rem; grid-template-columns: 1fr 1fr; }
.cfm-btn { min-height: 48px; padding: 0 1rem; border-radius: 14px; font: inherit; font-size: .98rem; font-weight: 700; cursor: pointer; border: 1.5px solid var(--border); background: var(--surface); color: var(--text-primary); transition: background-color .15s ease, border-color .15s ease, transform .1s ease; }
.cfm-btn:active { transform: scale(.98); }
.cfm-btn:disabled { opacity: .6; cursor: wait; }
.cfm-btn:focus-visible { outline: 3px solid var(--primary-ring, rgba(37, 99, 235, .35)); outline-offset: 2px; }
.cfm-cancel:hover { border-color: var(--text-secondary); }
.cfm-ok { border-color: var(--primary); background: var(--primary); color: #fff; }
.cfm-ok:hover { background: var(--primary-hover, #1D4ED8); }

/* Action destructive : rouge, pour que le choix soit évident. */
.cfm.is-danger .cfm-icon { background: #FEE2E2; color: #DC2626; }
.cfm.is-danger .cfm-title { color: #991B1B; }
.cfm.is-danger .cfm-ok { border-color: #DC2626; background: #DC2626; }
.cfm.is-danger .cfm-ok:hover { background: #B91C1C; }

/* Téléphone : feuille qui monte depuis le bas, boutons pleine largeur. */
@media (max-width: 599px) {
  .cfm { position: fixed; inset: auto 0 0 0; width: 100%; max-width: 100%; border-radius: 22px 22px 0 0; }
  .cfm-box { padding: 1.25rem 1.1rem calc(1.1rem + env(safe-area-inset-bottom, 0px)); }
  .cfm-actions { grid-template-columns: 1fr; }
  .cfm-ok { order: -1; }
}
@media (prefers-reduced-motion: reduce) { .cfm[open], .cfm[open]::backdrop { animation: none; } }
