/*
 * Bestätigungs- und Eingabedialog (Ersatz für die nativen Browser-Dialoge).
 *
 * BEFUND (Nutzermeldung 2026-08-03): 24 Aufrufe von `confirm()`/`prompt()` in
 * 13 Masken. Ein nativer Dialog kommt vom Browser und ignoriert jedes Theme —
 * er war der Grund, warum „nicht alle Dialoge im ausgewählten Theme" waren.
 *
 * Ausschließlich Themenvariablen, keine harten Farbwerte: die Maske muss alle
 * vier Themes mitmachen.
 */

.vc-confirm-backdrop {
  position: fixed;
  inset: 0;
  /* Über allem — auch über Overlays, die selbst schon hoch liegen. Ein
     Rückfragedialog, der hinter seiner eigenen Maske verschwindet, blockiert
     die Bedienung, ohne sichtbar zu sein. */
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: color-mix(in srgb, var(--surface-sunken, #0f172a) 62%, transparent);
  backdrop-filter: blur(2px);
}

.vc-confirm {
  width: min(30rem, 100%);
  max-height: 80vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 1.25rem 1.4rem;
  border-radius: var(--radius-lg, 12px);
  background: var(--surface-elevated);
  color: var(--text);
  border: 1px solid color-mix(in srgb, var(--border) 82%, transparent);
  box-shadow: var(--shadow-overlay, var(--shadow-card));
  font-family: var(--app-font-sans, 'Roboto', 'Segoe UI', Arial, sans-serif);
}

.vc-confirm--danger {
  border-color: color-mix(in srgb, var(--danger) 55%, var(--border));
}

.vc-confirm-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}

.vc-confirm--danger .vc-confirm-title {
  color: var(--danger);
}

.vc-confirm-body {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.vc-confirm-line {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--text-muted, var(--text));
  /* Die Texte stammen aus `confirm()`-Aufrufen und enthalten Bezeichner,
     Pfade und IDs — die dürfen nicht mitten im Wort umbrechen. */
  overflow-wrap: anywhere;
}

/* Die erste Zeile ist im Bestand die eigentliche Frage; sie trägt stärker. */
.vc-confirm-line:first-child {
  color: var(--text);
  font-weight: 600;
}

/* Eine leere Zeile im Quelltext trennt Absätze — sie bekommt Höhe statt zu
   verschwinden, sonst kleben Frage und Hinweis aneinander. */
.vc-confirm-line:empty {
  min-height: 0.4rem;
}

.vc-confirm-input {
  width: 100%;
  padding: 0.45rem 0.6rem;
  border-radius: var(--radius-md, 8px);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

.vc-confirm-input:focus-visible {
  outline: 2px solid var(--focus-ring, var(--accent-blue, var(--text)));
  outline-offset: 1px;
}

.vc-confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.15rem;
}

html[data-core-theme="avangers"] .vc-confirm {
  border-radius: 0;
  clip-path: polygon(0 14px, 14px 0, calc(100% - 40px) 0, 100% 12px,
    100% calc(100% - 14px), calc(100% - 14px) 100%, 12px 100%, 0 calc(100% - 18px));
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-soft), var(--shadow-overlay);
}

html[data-core-theme="avangers"] .vc-confirm-title {
  font-family: "Rajdhani", "Orbitron", "Roboto Condensed", "Segoe UI", Arial, sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Tippbestätigung (SPEC-0644 §6): das Feld erscheint nur, wenn der Handgriff
   nichts zurücknehmen kann. Es steht bewusst ZWISCHEN Text und Knöpfen — wer
   zum Bestätigen greift, kommt an ihm nicht vorbei. */
.vc-confirm-require {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.82rem;
  color: var(--text-muted, var(--text));
}

.vc-confirm-require b {
  color: var(--danger);
  font-family: var(--core-font-mono, ui-monospace, monospace);
  /* Der geforderte Text wird abgetippt — er muss zeichengenau lesbar sein,
     auch bei ähnlichen Glyphen wie I/l/1. */
  letter-spacing: 0.02em;
}

.vc-confirm-actions .vc-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
