/* Potvrzovací dialog (js/komponenty/potvrzeni.js) — náhrada window.confirm().
   Jen hex/rgba a px: stránky nového i starého designu (theme.css) ho sdílejí a anotace přes
   html2canvas neumí moderní barevné funkce. Hodnoty odpovídají tokenům z tokeny.css
   (#0A0A0A text, #575752 text-2, #E8E8E4 linka, #FAFAF8 plocha-2, #1DA35A značka, #B0301C chyba). */

dialog.potvrzeni {
  position: fixed;
  inset: 0;
  width: 100%;
  max-width: 100%;
  height: 100%;
  max-height: 100%;
  margin: 0;
  padding: 16px;
  border: 0;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0A0A0A;
  font: 400 13px/1.5 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  overflow: auto;
  /* S showModal leží v top layer nad vším; z-index platí pro fallback `open` bez top layer
     (nad shellem 80–90, dialogy .modal-scrim 1050 i toasty 1100). */
  z-index: 1200;
}
dialog.potvrzeni:not([open]) { display: none; }
dialog.potvrzeni::backdrop {
  background: rgba(10, 10, 10, .35);
  animation: potvrzeni-podklad 180ms cubic-bezier(.2, .8, .2, 1);
}

.potvrzeni__karta {
  width: 100%;
  max-width: 420px;
  box-sizing: border-box;
  padding: 20px 20px 16px;
  border: 1px solid #E8E8E4;
  border-radius: 14px;
  background: #FFFFFF;
  box-shadow: 0 1px 2px rgba(10, 10, 10, .06), 0 16px 40px rgba(10, 10, 10, .16);
  animation: potvrzeni-karta 180ms cubic-bezier(.2, .8, .2, 1);
}

.potvrzeni__hlava { display: flex; align-items: flex-start; gap: 14px; }
.potvrzeni__ikona {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: #DCFCE7;
  color: #1DA35A;
}
.potvrzeni--nebezpecne .potvrzeni__ikona { background: #FDECE8; color: #B0301C; }
.potvrzeni__texty { flex: 1 1 auto; min-width: 0; padding-top: 2px; }
.potvrzeni__titulek {
  margin: 0;
  font: 600 16px/1.35 'Outfit', 'Inter', system-ui, sans-serif;
  color: #0A0A0A;
  overflow-wrap: anywhere;
}
.potvrzeni__text {
  margin: 6px 0 0;
  font-size: 13px;
  line-height: 1.5;
  color: #575752;
  white-space: pre-line;
  overflow-wrap: anywhere;
}
.potvrzeni__detail {
  margin-top: 12px;
  padding: 10px 12px;
  max-height: 180px;
  overflow: auto;
  border: 1px solid #E8E8E4;
  border-radius: 10px;
  background: #FAFAF8;
  font-size: 12px;
  line-height: 1.5;
  color: #0A0A0A;
  white-space: pre-line;
  overflow-wrap: anywhere;
}
.potvrzeni__seznam { margin: 0; padding: 0 0 0 16px; }
.potvrzeni__seznam li + li { margin-top: 2px; }

.potvrzeni__pata { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.potvrzeni__tl {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 88px;
  height: 34px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 999px;
  font: 500 13px/1 'Inter', system-ui, sans-serif;
  white-space: nowrap;
  cursor: pointer;
  transition: background 120ms cubic-bezier(.2, .8, .2, 1), filter 120ms cubic-bezier(.2, .8, .2, 1), transform 100ms cubic-bezier(.2, .8, .2, 1);
}
.potvrzeni__tl:active { transform: scale(.96); }
.potvrzeni__tl:focus-visible { outline: 2px solid #0A0A0A; outline-offset: 2px; }
.potvrzeni__tl--zrusit { background: #FFFFFF; border-color: #D8D8D2; color: #0A0A0A; }
.potvrzeni__tl--zrusit:hover { background: #FAFAF8; }
.potvrzeni__tl--hlavni { background: #76FB91; color: #0A0A0A; }
.potvrzeni__tl--hlavni:hover { filter: brightness(.94); }
.potvrzeni__tl--nebezpecne { background: #B0301C; color: #FFFFFF; }
.potvrzeni__tl--nebezpecne:hover { background: #962816; }

@keyframes potvrzeni-podklad { from { opacity: 0; } to { opacity: 1; } }
@keyframes potvrzeni-karta {
  from { opacity: 0; transform: translateY(6px) scale(.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  dialog.potvrzeni::backdrop { animation: potvrzeni-podklad 120ms linear; }
  .potvrzeni__karta { animation: potvrzeni-podklad 120ms linear; }
  .potvrzeni__tl, .potvrzeni__tl:active { transition: none; transform: none; }
}

@media (max-width: 480px) {
  .potvrzeni__pata { flex-direction: column-reverse; }
  .potvrzeni__tl { width: 100%; height: 40px; }
}
