/* ===========================================================================
   Interaktive Terminal-Demo (Payter Apollo)
   /produkte/payter-apollo und /payter (uid 20), Skript: js/payter-demo.js

   Eigene Datei statt Tailwind-Schicht: wird nur auf diesen zwei Seiten geladen.
   Bewusst ausserhalb der @layer-Kaskade, damit Reboot-Regeln fuer button/p/dl
   die nachgebaute Oberflaeche nicht beruehren.

   Der Bildschirm rechnet in em: 1em = 1/32 der Displaybreite, also 10 "Pixel"
   des echten 320 x 480 Displays. So skaliert die Oberflaeche mit dem Geraet.
   Farben der Bildschirme nach Fotos des Terminals im Betrieb.
   =========================================================================== */

.eul-payter-demo[hidden] { display: none; }
.eul-payter-demo { margin-block: var(--eul-space-stack, 1.5rem); }

.eul-pd {
  --pd-akzent: #93c9f3;
  --pd-blase: #4f94cf;
  --pd-feld: #a7d6f7;
  --pd-knopf: #93c0ea;
  --pd-knopf-2: #86aed3;
  --pd-tinte: #0a1720;
  --pd-gruen: #6be38f;
  --pd-gelb: #ffd166;
  --pd-blau: #8ac8ff;
  position: relative;
  display: grid;
  gap: clamp(1.5rem, 3vw, 3rem);
  padding: clamp(1rem, 3.2vw, 2.75rem);
  color: #fff;
  background: radial-gradient(120% 130% at 12% 8%, #276e83 0%, #174a58 46%, #0e323d 100%);
  border-radius: var(--eul-radius, 0.25rem);
}
.eul-pd :focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.eul-pd p, .eul-pd dl, .eul-pd dd, .eul-pd ul { margin: 0; }
.eul-pd button { font: inherit; cursor: pointer; }

@media (min-width: 62rem) {
  .eul-pd { grid-template-columns: minmax(21rem, 31rem) minmax(0, 1fr); align-items: center; }
}

/* ------------------------------------------------------------- Geraet
   Foto aus Blender (migration/tools/payter_demo_szene): Displaylage in
   Bruchteilen des Bildes, Massstab wie das echte Geraet. Auf dem Handy
   rueckt .eul-pd__foto naeher heran, damit die Oberflaeche lesbar bleibt. */
.eul-pd__links { min-width: 0; }
.eul-pd__geraet {
  position: relative;
  width: 100%;
  max-width: 31rem;
  aspect-ratio: 700 / 896;
  margin-inline: auto;
  overflow: hidden;
  background: #1c1f22;
  border-radius: var(--eul-radius, 0.25rem);
  box-shadow: 0 1.25rem 2.5rem rgba(4, 22, 28, 0.5);
}
.eul-pd__foto {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  aspect-ratio: 700 / 896;
  background: url("../img/payter-demo/terminal-hell.webp") center / 100% 100% no-repeat;
}
.eul-pd__display, .eul-pd__reflex { position: absolute; left: 25.35%; top: 20.3%; width: 49.3%; height: 57.81%; }
.eul-pd__display { overflow: hidden; background: #000; border-radius: 0.6%; container-type: inline-size; }
/* Spiegelung im Glas liegt ueber der Oberflaeche: derselbe Bildausschnitt, nur das Licht */
.eul-pd__reflex {
  pointer-events: none;
  background: url("../img/payter-demo/terminal-hell.webp") 50% 48.12% / 202.84% 172.98% no-repeat;
  mix-blend-mode: screen;
}
.eul-pd__leds { position: absolute; left: 13.98%; top: 44.87%; width: 2.3%; aspect-ratio: 1; transform: translate(-50%, -50%); }
.eul-pd__leds i { display: block; width: 100%; height: 100%; border-radius: 50%; }
.eul-pd__leds[data-led="lesen"] i { background: #6bb7ff; box-shadow: 0 0 0.75rem 0.15rem #6bb7ff; animation: eul-pd-blink 1.1s ease-in-out infinite; }
.eul-pd__leds[data-led="ok"] i { background: var(--pd-gruen); box-shadow: 0 0 0.9rem 0.2rem var(--pd-gruen); }
@media (max-width: 61.99rem) { .eul-pd__geraet { max-width: 26rem; } }
@media (max-width: 40rem) {
  /* ganzes Geraet zeigen, nur der Plattenrand wird knapper */
  .eul-pd__geraet { max-width: none; }
  .eul-pd__foto { transform: scale(1.08); transform-origin: 50% 50%; }
}

/* ----------------------------------------------------------- Bildschirm */
.eul-pd__bild {
  position: absolute;
  inset: 0;
  font-family: var(--eul-font-body);
  font-size: 9.5px;
  font-size: calc(100cqw / 32);
  line-height: 1.2;
  color: var(--pd-akzent);
}
.eul-pd__s {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: 1.5em 1.6em 1.6em;
  text-align: center;
  animation: eul-pd-rein 0.18s ease-out;
}
.eul-pd__s--lesen { cursor: pointer; }
.eul-pd__s--knopf { width: 100%; align-items: stretch; border: 0; background: none; color: inherit; }
.eul-pd__logo { flex: none; display: block; width: 19em; height: auto; margin-inline: auto; }
.eul-pd__logo-s { fill: var(--pd-akzent); }
.eul-pd__logo-b { fill: var(--pd-blase); }

.eul-pd__karussell { flex: none; height: 9.8em; margin: 1.4em -1.6em 0; overflow: hidden; }
.eul-pd__spur { display: flex; gap: 1.2em; width: max-content; margin-left: -4.7em; animation: eul-pd-karussell 12s cubic-bezier(0.6, 0, 0.3, 1) infinite; }
.eul-pd__bank { position: relative; flex: none; display: block; width: 13em; height: 9.6em; border-radius: 0.9em; background: linear-gradient(150deg, #b6d8f3, #9dc6ea); color: var(--pd-tinte); text-align: left; }
.eul-pd__bank svg { position: absolute; top: 0.9em; right: 1em; width: 5.6em; height: auto; }
.eul-pd__bank-name, .eul-pd__bank-nr { position: absolute; left: 0.95em; font-size: 1.05em; white-space: nowrap; }
.eul-pd__bank-name { bottom: 2.3em; }
.eul-pd__bank-nr { bottom: 0.9em; }

.eul-pd__gross { margin-top: auto !important; font-size: 4.2em; line-height: 1.1; font-weight: 500; }
.eul-pd__klein { margin-top: 0.15em !important; font-size: 2.2em; }
.eul-pd__titel { display: block; margin-block: 0.4em 0.35em !important; font-size: 3.1em; line-height: 1.15; font-weight: 500; }
.eul-pd__titel--evse { font-size: 3.3em; white-space: nowrap; }
.eul-pd__mittel { font-size: 2.9em; line-height: 1.15; font-weight: 500; }
.eul-pd__hinweis { display: block; font-size: 2em; line-height: 1.25; color: #bfe0f8; }
.eul-pd__betrag { margin-top: 0.8em !important; font-size: 5.6em; line-height: 1; font-weight: 500; white-space: nowrap; }
.eul-pd__betrag small { font-size: 0.42em; }

.eul-pd__reihe { display: flex; gap: 1.1em; margin-top: auto; }
.eul-pd__reihe--ueber { position: relative; margin: -2.4em -0.5em 0; }

.eul-pd__tb {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45em;
  min-height: 2.3em;
  padding: 0 0.5em;
  font-size: 2.6em !important;
  font-weight: 500;
  line-height: 1.1;
  color: var(--pd-tinte);
  background: var(--pd-knopf);
  border: 0;
  border-radius: 0.34em;
}
.eul-pd__tb:hover { background: #abd3f5; }
.eul-pd__tb:active { background: #7fb0de; }
.eul-pd__tb--breit { flex: 2.1; }
.eul-pd__tb--icon { flex: 1; }
.eul-pd__tb--dialog { flex: 1; background: var(--pd-knopf-2); }
.eul-pd__tb.is-weiter { animation: eul-pd-puls 1.7s ease-out infinite; }

.eul-pd__icon { flex: none; width: 1.3em; height: 1.3em; fill: currentColor; }
.eul-pd__icon--linie { fill: none; stroke: currentColor; stroke-width: 1.5; }
.eul-pd__tb--icon .eul-pd__icon { width: 1.65em; height: 1.65em; }
.eul-pd__flagge { flex: none; width: 1.6em; height: auto; margin-right: 0.35em; }

.eul-pd__liste { flex: 1; display: flex; flex-direction: column; gap: 0.8em; min-height: 0; padding: 0.3em !important; margin-inline: -0.3em !important; overflow-y: auto; list-style: none; scrollbar-width: none; }
.eul-pd__liste::-webkit-scrollbar { display: none; }
.eul-pd__liste li { flex: none; margin: 0; padding: 0; }
.eul-pd__liste li::before, .eul-pd__liste li::marker { content: none; }
.eul-pd__zeile { width: 100%; font-size: 2.9em !important; min-height: 2.25em; }
.eul-pd__zeile--sprache { justify-content: flex-start; padding-inline: 0.7em; }

.eul-pd__feld { flex: 1; display: flex; flex-direction: column; padding: 1.3em 0.8em 3em; font-size: 2.3em; line-height: 1.32; color: var(--pd-tinte); background: var(--pd-feld); border-radius: 0.4em; min-height: 0; }
.eul-pd__feld--mitte { padding-top: 1.6em; font-size: 2.6em; }

.eul-pd__s--lesen .eul-pd__betrag { color: var(--pd-akzent); }
.eul-pd__kontaktlos { flex: none; width: 20em; height: auto; margin: 1.5em auto 1.3em; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.eul-pd__k-rand { stroke: var(--pd-akzent); stroke-width: 2.5; }
.eul-pd__k-welle { stroke: var(--pd-akzent); stroke-width: 6; animation: eul-pd-welle 1.4s ease-in-out infinite; }
.eul-pd__k-hand { stroke: #d9eefb; stroke-width: 2.5; }

.eul-pd__s--warten { justify-content: flex-start; }
.eul-pd__dreh { display: block; width: 7em; height: 7em; margin: auto auto 1.6em; border: 0.7em solid rgba(147, 201, 243, 0.25); border-top-color: var(--pd-akzent); border-radius: 50%; animation: eul-pd-dreh 1s linear infinite; }
.eul-pd__s--warten .eul-pd__mittel { margin-bottom: auto !important; }

.eul-pd__qr { display: block; width: 19em; height: 19em; margin: 0.2em auto 1em; padding: 0.5em; background: #fff; border-radius: 0.6em; }
.eul-pd__qr svg { display: block; width: 100%; height: 100%; }

/* ------------------------------------------------------- Eulektro-Karte */
.eul-pd__karte-knopf {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.9rem;
  width: 100%;
  max-width: 31rem;
  margin: 1rem auto 0;
  padding: 0.55rem 1rem;
  color: #fff;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 0;
}
.eul-pd__karte-knopf:not(.is-bereit) { color: rgba(255, 255, 255, 0.72); background: transparent; border-color: rgba(255, 255, 255, 0.18); }
.eul-pd__karte-knopf.is-bereit:hover { background: rgba(255, 255, 255, 0.18); }
.eul-pd__karte-knopf.is-weiter { animation: eul-pd-puls 1.7s ease-out infinite; }
.eul-pd__karte {
  position: relative;
  z-index: 20;
  display: block;
  flex: none;
  width: 6.6rem;
  height: 4.15rem;
  transform-style: preserve-3d;
  transition: transform 0.55s cubic-bezier(0.3, 0.75, 0.3, 1);
}
.eul-pd__karte.is-gedreht { transform: rotateY(180deg) scale(1.9); }
.eul-pd__karte-seite {
  position: absolute;
  inset: 0;
  display: block;
  overflow: hidden;
  border-radius: 0.38rem;
  box-shadow: 0 0.3rem 0.85rem rgba(0, 0, 0, 0.45);
  backface-visibility: hidden;
  text-align: left;
  font-weight: 600;
  color: #fff;
}
.eul-pd__karte-vorn { background: radial-gradient(130% 150% at 95% 0%, #3b9db5 0%, #21697c 42%, #0f3a47 100%); }
.eul-pd__karte-vorn::after { content: ""; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 38%, rgba(255, 255, 255, 0.28) 50%, transparent 62%); }
.eul-pd__karte .eul-pd__logo { position: absolute; left: 0.42rem; top: 0.34rem; width: 3.1rem; margin: 0; }
.eul-pd__karte .eul-pd__logo-s { fill: #fff; }
.eul-pd__karte .eul-pd__logo-b { fill: #8fd0e2; }
.eul-pd__karte-chip { position: absolute; left: 0.45rem; top: 1.5rem; width: 0.82rem; height: 0.62rem; border-radius: 0.12rem; background: linear-gradient(135deg, #f0d48a, #c79a3c); }
.eul-pd__karte-nr { position: absolute; left: 0.45rem; bottom: 0.82rem; font-size: 0.5rem; line-height: 1; letter-spacing: 0.04em; white-space: nowrap; }
.eul-pd__karte-name { position: absolute; left: 0.45rem; bottom: 0.34rem; font-size: 0.42rem; line-height: 1; letter-spacing: 0.05em; }
.eul-pd__karte-bsp { position: absolute; right: 0.42rem; bottom: 0.34rem; font-size: 0.4rem; line-height: 1; opacity: 0.85; }
.eul-pd__karte-hinten { padding: 1.32rem 0.45rem 0; font-size: 0.4rem; line-height: 1.25; font-weight: 400; color: #eaf6f9; background: linear-gradient(135deg, #174a58, #0f3a47); transform: rotateY(180deg); }
.eul-pd__karte-hinten strong { display: block; margin-bottom: 0.1rem; font-size: 0.46rem; color: #fff; }
.eul-pd__karte-streifen { position: absolute; left: 0; right: 0; top: 0.36rem; height: 0.72rem; background: #0a1417; }

/* ------------------------------------------------------------ Erklaerung */
.eul-pd__rechts { min-width: 0; }
.eul-pd__coach { display: grid; gap: 0.4rem; align-content: start; min-height: 11rem; }
.eul-pd__kopf { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.eul-pd__schritt { font-size: var(--eul-text-sm, 0.875rem); font-weight: 700; color: #bfe6f2; }
.eul-pd__neu { flex: none; padding: 0.3rem 0.75rem; font-size: var(--eul-text-sm, 0.875rem); color: #fff; background: none; border: 1px solid rgba(255, 255, 255, 0.45); border-radius: 0; }
.eul-pd__neu:hover { background: rgba(255, 255, 255, 0.12); }
.eul-pd__coach-titel { font-family: var(--eul-font-heading); font-size: clamp(1.25rem, 2.3vw, 1.625rem); font-weight: 700; line-height: 1.25; color: #fff; }
.eul-pd__coach-text { line-height: 1.45; color: rgba(255, 255, 255, 0.9); }
.eul-pd__coach-link { justify-self: start; color: #fff; font-weight: 700; text-decoration: underline; text-underline-offset: 0.15em; }
.eul-pd__coach-link[hidden] { display: none; }
.eul-pd__fuss strong { color: #fff; }

/* ----------------------------------------------------------- Ladepunkte
   Eine Szene aus Blender, je Haelfte drei Zustaende uebereinander; die
   Bilder laden erst, wenn die Demo in die Naehe des Sichtbereichs kommt. */
.eul-pd__punkte { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 0; margin-top: 1.25rem; }
.eul-pd__punkt { min-width: 0; }
.eul-pd__lp-bild { position: relative; display: block; aspect-ratio: 800 / 720; background: #24331f; }
.eul-pd__punkt:first-child .eul-pd__lp-bild i { right: -1px; } /* Naht zwischen den Bildhaelften */
.eul-pd__lp-bild i { position: absolute; inset: 0; background: center / cover no-repeat; opacity: 0; transition: opacity 0.45s ease; }
.eul-pd__punkt[data-state="frei"] [data-z="frei"],
.eul-pd__punkt[data-state="beendet"] [data-z="frei"],
.eul-pd__punkt[data-state="startet"] [data-z="startet"],
.eul-pd__punkt[data-state="laedt"] [data-z="laedt"] { opacity: 1; }
.eul-payter-demo.is-nah .eul-pd__lp-bild[data-seite="links"] [data-z="frei"] { background-image: url("../img/payter-demo/ladepunkte-links-frei.webp"); }
.eul-payter-demo.is-nah .eul-pd__lp-bild[data-seite="links"] [data-z="startet"] { background-image: url("../img/payter-demo/ladepunkte-links-startet.webp"); }
.eul-payter-demo.is-nah .eul-pd__lp-bild[data-seite="links"] [data-z="laedt"] { background-image: url("../img/payter-demo/ladepunkte-links-laedt.webp"); }
.eul-payter-demo.is-nah .eul-pd__lp-bild[data-seite="rechts"] [data-z="frei"] { background-image: url("../img/payter-demo/ladepunkte-rechts-frei.webp"); }
.eul-payter-demo.is-nah .eul-pd__lp-bild[data-seite="rechts"] [data-z="startet"] { background-image: url("../img/payter-demo/ladepunkte-rechts-startet.webp"); }
.eul-payter-demo.is-nah .eul-pd__lp-bild[data-seite="rechts"] [data-z="laedt"] { background-image: url("../img/payter-demo/ladepunkte-rechts-laedt.webp"); }
.eul-pd__glimmen { position: absolute; top: 38.76%; left: 63.44%; width: 24%; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%; background: radial-gradient(closest-side, rgba(80, 165, 255, 0.75), rgba(80, 165, 255, 0)); mix-blend-mode: screen; opacity: 0; }
.eul-pd__lp-bild[data-seite="rechts"] .eul-pd__glimmen { left: 36.56%; }
.eul-pd__punkt[data-state="laedt"] .eul-pd__glimmen { opacity: 1; animation: eul-pd-atmen 1.8s ease-in-out infinite; }

.eul-pd__info { padding: 0.65rem 0.75rem 0; }
.eul-pd__evse { font-size: var(--eul-text-sm, 0.875rem); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.eul-pd__status { display: inline-block; margin-block: 0.3rem 0.45rem; padding: 0.1rem 0.55rem; font-size: 0.8125rem; font-weight: 700; color: #0a2a34; background: #bfe6f2; }
.eul-pd__punkt[data-state="frei"] .eul-pd__status { background: var(--pd-gruen); }
.eul-pd__punkt[data-state="laedt"] .eul-pd__status { background: var(--pd-blau); }
.eul-pd__punkt[data-state="startet"] .eul-pd__status { background: var(--pd-gelb); }
.eul-pd__punkt[data-state="beendet"] .eul-pd__status { background: #fff; }
.eul-pd__werte { display: grid; gap: 0.1rem; font-size: var(--eul-text-sm, 0.875rem); font-variant-numeric: tabular-nums; }
.eul-pd__werte div { display: flex; justify-content: space-between; gap: 0.5rem; }
.eul-pd__werte dt { font-weight: 400; color: rgba(255, 255, 255, 0.78); }
.eul-pd__werte dd { font-weight: 700; color: #fff; white-space: nowrap; }
.eul-pd__fuss { margin-top: 1rem !important; font-size: var(--eul-text-sm, 0.875rem); color: rgba(255, 255, 255, 0.78); }

/* Demo als Eck-Band auf dem Galeriebild (Produktseite); nur das Band ist klickbar,
   die freie Ecke gehoert weiter dem Bild (Grossansicht). */
.eul-galerie:has(> .eul-galerie__ribbon) { position: relative; }
.eul-galerie__ribbon { position: absolute; top: 0; right: 0; z-index: 3; width: 8.5rem; height: 8.5rem; overflow: hidden; pointer-events: none; text-decoration: none; border-top-right-radius: var(--eul-radius, 0.25rem); }
.eul-galerie__ribbon span { position: absolute; top: 1.7rem; right: -2.9rem; display: flex; align-items: center; justify-content: center; gap: 0.4rem; width: 12rem; padding: 0.5rem 0; font-weight: 700; color: #fff; background: var(--eul-brand); box-shadow: 0 0.25rem 0.6rem rgba(0, 0, 0, 0.3); transform: rotate(45deg); pointer-events: auto; }
.eul-galerie__ribbon:hover span { background: var(--eul-brand-hover, #174a58); }
.eul-galerie__ribbon:focus-visible { outline: none; }
.eul-galerie__ribbon:focus-visible span { outline: 3px solid #fff; outline-offset: -5px; }

/* ---------------------------------------------- aktueller Schritt im Ablauf */
.eul-flow-item.is-dran { outline: 3px solid var(--eul-brand); outline-offset: -3px; }
.eul-flow-item--accent.is-dran { outline-color: var(--eul-ink); }

/* ------------------------------------------------------------ Bewegung */
@keyframes eul-pd-rein { from { opacity: 0; } to { opacity: 1; } }
@keyframes eul-pd-karussell {
  0%, 28% { transform: translateX(0); }
  33%, 61% { transform: translateX(-14.2em); }
  66%, 94% { transform: translateX(-28.4em); }
  100% { transform: translateX(-42.6em); }
}
@keyframes eul-pd-puls {
  0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.55); }
  70%, 100% { box-shadow: 0 0 0 0.3em rgba(255, 255, 255, 0); }
}
@keyframes eul-pd-blink { 50% { opacity: 0.35; } }
@keyframes eul-pd-atmen { 50% { opacity: 0.25; } }
@keyframes eul-pd-dreh { to { transform: rotate(360deg); } }
@keyframes eul-pd-welle { 50% { opacity: 0.35; } }

.eul-payter-demo.is-pausiert * { animation-play-state: paused !important; }
@media (prefers-reduced-motion: reduce) {
  .eul-pd *, .eul-flow-item { animation: none !important; transition: none !important; }
}
