/* AR-Knopf, Fenster (Dialogsystem) und Hinweise (Toasts) — gemeinsam für den Onepager und die
   Kunstwerke-Seite. Aus onepager_styles.css verschoben (2026-10-13); keine seitenweiten Regeln. */

/* Hinweise mittig wie die Fenster (Punkt 44). Der Behälter lässt Klicks durch, nur die
   Hinweise selbst fangen sie ab. Ebene über den Fenstern (.dialog-overlay 10010) und
   damit über allem anderen (Bearbeiten-Fenster 10001, Stil-Info 10000, Bildvergrößerung 9999). */
#app-toasts {
    position: fixed;
    inset: 0;
    z-index: 10020;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 20px;
    pointer-events: none;
}

/* AR-Icon (links neben dem Edit-Icon); erscheint nur auf AR-fähigen Geräten und am Laptop —
   onepager.arStart.js setzt dafür die Klasse .ar-supported bzw. .ar-qr auf <html> */
.ar-icon-btn {
    position: absolute;
    top: 8px;
    right: 60px;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(4px);
    box-shadow: 0 4px 14px -4px rgba(0,0,0,0.35);
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    transition: background .25s, transform .25s;
}

/* .ar-qr: Laptop ohne AR — das Symbol öffnet dort das QR-Fenster */
.ar-supported .ar-icon-btn,
.ar-qr .ar-icon-btn {
    display: flex;
}

/* AR-Hinweistexte im Kunstwerk-Subtitle: .ar-hint-ar (Tipp-Text) nur auf AR-fähigen Geräten,
   .ar-hint-qr (Laptop-Text) nur auf Laptops ohne AR */
.ar-hint {
    display: none;
}

.ar-supported .ar-hint-ar {
    display: inline;
}

.ar-qr:not(.ar-supported) .ar-hint-qr {
    display: inline;
}

/* Poster-Seite: Knopf „An deiner Wand ansehen“ unten mittig im Produktbild (poster.ar.js); sichtbar
   wie das AR-Symbol nur mit .ar-supported bzw. .ar-qr, [hidden] bei „Digital“ und ohne Motiv */
.poster-ar-knopf {
    position: absolute;
    left: 50%;
    bottom: 16px;
    transform: translateX(-50%);
    z-index: 5;
    display: none;
    align-items: center;
    gap: 8px;
    padding: 10px 18px 10px 14px;
    border: none;
    border-radius: 999px;
    background: #fff;
    color: #111;
    font-size: 14px;
    box-shadow: 0 2px 10px rgba(0,0,0,.25);
    white-space: nowrap;
    cursor: pointer;
}

.ar-supported .poster-ar-knopf,
.ar-qr .poster-ar-knopf {
    display: inline-flex;
}

.poster-ar-knopf[hidden] {
    display: none !important;
}

.poster-ar-knopf svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.7;
}

.ar-icon-btn:hover {
    background: #000;
    color: #fff;
    transform: scale(1.05);
}

.ar-icon-btn svg {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
}

/* ============================================
   FENSTER-DESIGN (schwarz/weiß/minimal, CI) — 2026-10-30
   Spec: docs/superpowers/specs/2026-10-30-fenster-design-design.md
   Entwurf: docs/superpowers/entwuerfe/2026-10-30-hinweisfenster-entwurf.html
   Gilt für notify.confirm (Entscheidung, Info, AR, QR) und die Meldungen (Toasts).
   Cyan #5AC4C2 wie auf der Startseite gemessen (CI: #4DD4D1).
   ============================================ */
.dialog-overlay,
#app-toasts {
    --tinte: #1A1A1A;
    --dunkel: #2B2B2B;
    --grau: #666666;
    --rahmen: #DDDDDD;
    --cyan: #5AC4C2;
}

.dialog-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(26, 26, 26, 0.6);
    z-index: 10010; /* über dem Bearbeiten-Fenster (10001) und allen anderen Ebenen (Punkt 49) */
    padding: 16px;
    transition: opacity .25s ease;
}

.dialog-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.dialog-overlay.visible {
    opacity: 1;
}

.dialog-panel {
    position: relative;
    width: min(480px, 100%);
    max-height: 100%;
    overflow: auto;
    display: flex;
    flex-direction: column;
    padding: 28px;
    border-radius: 10px;
    background: #fff;
    color: var(--tinte);
    box-shadow: 0 15px 65px rgba(0, 0, 0, 0.27);
    font-family: 'Lato', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    text-align: center;
}

.dialog-title {
    margin: 0 40px 16px; /* seitlich Platz, damit das × oben rechts den zentrierten Titel nie berührt */
    font-size: 22px;
    line-height: 1.25;
    font-weight: 700;
    color: var(--tinte);
    text-align: center;
}

/* × der Info-Fenster (Limit, Fehler): rund, oben rechts; Hover: ganzer Kreis cyan, Zeichen schwarz */
.dialog-close {
    position: absolute;
    top: 10px;
    right: 12px;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--tinte);
    font-family: inherit;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color .15s ease-in-out;
}

.dialog-close:hover {
    background: var(--cyan);
    color: var(--tinte);
}

.dialog-close:focus-visible {
    outline: 2px solid var(--tinte);
    outline-offset: 2px;
}

/* Text in der Mitte mit feinem hellgrauem Rahmen (wie in der alten Version) */
.dialog-text {
    margin: 0 0 22px;
    padding: 14px 16px;
    border: 1px solid var(--rahmen);
    border-radius: 8px;
    font-size: 15px;
    line-height: 1.55;
    color: var(--tinte);
    text-align: center;
}

/* Info-Fenster ohne Knopf: der Text-Kasten ist das Letzte, kein zusätzlicher Abstand nach unten */
.dialog-panel > .dialog-text:last-child {
    margin-bottom: 0;
}

/* Kleinere Schrift für lange Hinweise (AR-Vorschau); Farben wie bei jedem Text in der Mitte, keine Füllung */
.dialog-text.klein {
    font-size: 13px;
}

/* Knöpfe wie „Jetzt Kunstwerk erstellen“ auf der Startseite: 6 px rund, Hover = ganzer Knopf cyan */
.dialog-btn {
    padding: 14px 28px;
    border: 1px solid var(--tinte);
    border-radius: 6px;
    background: #fff;
    color: var(--tinte);
    font-family: inherit;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.3;
    cursor: pointer;
    transition: color .15s ease-in-out, background-color .15s ease-in-out, border-color .15s ease-in-out;
}

.dialog-btn.primary {
    background: var(--tinte);
    color: #fff;
}

/* Die schwarze Auswahl hat eine eigene Hover-Zeile, sonst gewinnt ihre Fläche und nur der Rand wird cyan */
.dialog-btn:hover,
.dialog-btn.dialog-auswahl-btn[aria-pressed="true"]:hover {
    background: var(--cyan);
    border-color: var(--cyan);
    color: #fff;
}

.dialog-btn:focus-visible {
    outline: 2px solid var(--tinte);
    outline-offset: 2px;
}

/* Aktionsknöpfe immer über die volle Breite: zwei je zur Hälfte (Hauptknopf rechts), einer über die ganze Zeile */
.dialog-actions {
    display: flex;
    gap: 12px;
    margin-top: 4px;
}

.dialog-actions .dialog-btn {
    flex: 1 1 0;
    min-width: 0;
}

/* Auswahlzeile im Fenster, z. B. die AR-Größe (Punkt 39): gewählter Knopf schwarz gefüllt */
.dialog-auswahl {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin: 0 0 18px;
    width: 100%;
}

.dialog-auswahl-label {
    font-size: 14px;
    color: var(--grau);
}

.dialog-auswahl-optionen {
    display: flex;
    gap: 10px;
    width: 100%;
}

/* min-width/flex: auf schmalen Handys (320 px) sonst über den Fensterrand hinaus */
.dialog-btn.dialog-auswahl-btn {
    flex: 1 1 0;
    min-width: 0;
    padding: 10px 12px;
}

.dialog-btn.dialog-auswahl-btn[aria-pressed="true"] {
    background: var(--tinte);
    color: #fff;
}

/* QR-Fenster (Phase B): Titel oben über beiden Spalten, links der Code, rechts Größenwahl und Schritte;
   unter 640 px stehen die Spalten untereinander */
.dialog-panel.dialog-zweispaltig {
    width: min(680px, 100%);
}

.dialog-spalten {
    display: flex;
    gap: 26px;
    align-items: flex-start;
    margin: 0 0 18px;
}

.dialog-seite {
    flex: none;
}

.dialog-haupt {
    flex: 1 1 0;
    min-width: 0;
}

.ar-qr-code {
    box-sizing: border-box;
    min-width: 240px;
    min-height: 240px;
    padding: 10px;
    border: 1px solid var(--rahmen);
    border-radius: 10px;
    background: #fff;
    color: var(--tinte);
    font-size: 13px;
    line-height: 1.4;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ar-qr-code svg {
    width: 218px;
    height: 218px;
    display: block;
}

/* Schritte: cyane Nummern-Kreise mit schwarzer Zahl (CI: Cyan für Step-Nummerierung, Kontrast ca. 10:1) */
.ar-qr-schritte {
    list-style: none;
    counter-reset: schritt;
    display: inline-block;
    text-align: left;
    margin: 0 0 8px;
    padding: 0;
    font-size: 14px;
    line-height: 1.5;
}

.ar-qr-schritte li {
    counter-increment: schritt;
    position: relative;
    margin: 0 0 10px;
    padding-left: 34px;
}

.ar-qr-schritte li::before {
    content: counter(schritt);
    position: absolute;
    left: 0;
    top: 0;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--cyan);
    color: var(--tinte);
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ar-qr-geraete {
    margin: 0;
    font-size: 12px;
    color: var(--grau);
}

@media (max-width: 640px) {
    .dialog-spalten {
        flex-direction: column;
        align-items: center;
        gap: 16px;
    }

    .dialog-haupt {
        width: 100%;
    }
}

/* Handy: Fenster fast randlos, Knöpfe untereinander, Hauptknopf oben */
@media (max-width: 520px) {
    .dialog-panel {
        padding: 22px;
    }

    .dialog-actions {
        flex-direction: column-reverse;
    }

    .dialog-actions .dialog-btn {
        flex: none;
        width: 100%;
    }
}

/* ============================================
   MELDUNGEN (TOASTS)
   ============================================ */
/* Dunkel (#2B2B2B) mit 5 px Cyan-Streifen links, Text zentriert, × rund (Hover: ganzer Kreis cyan,
   Zeichen schwarz). Die Klassen app-toast-info/-success/-warn/-error haben kein eigenes Aussehen. */
.app-toast {
    position: relative;
    pointer-events: auto;
    width: 90%;
    max-width: 480px;
    box-sizing: border-box;
    padding: 16px 48px;
    background: var(--dunkel);
    color: #fff;
    border-radius: 10px;
    border-left: 5px solid var(--cyan);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
    font-family: 'Lato', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    text-align: center;
    cursor: pointer;
    opacity: 0;
    transform: scale(0.95);
    transition: opacity .25s, transform .25s;
}
.app-toast.visible {
    opacity: 1;
    transform: scale(1);
}
.toast-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: #fff;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color .15s ease-in-out, color .15s ease-in-out;
}
.toast-close:hover {
    background: var(--cyan);
    color: var(--tinte);
}
.toast-close:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}
.toast-msg {
    display: inline-block;
}
