/* ═══════════════════════════════════════════════════════════════════
   ANALYSE-POPUP — Umsetzung von „Analyse-Sektion.dc.html" (Claude Design)
   Stand 05.08.2026

   Entwurf 3a (1040 px, zweispaltig mit 3D-Mockup)  → Desktop
   Entwurf 4a (390 px, gestapelt)                    → Mobil

   Abweichungen vom Entwurf (bewusst):
   · Hintergrund NICHT der blaue Verlauf des Entwurfs
     (linear-gradient(165deg,#0b1120,#0a0f1c 55%,#0d1322)), sondern der
     Hero-Hintergrund: #07080A mit goldenem und blauem Drift-Orb.
     Orb-Maße auf die Popup-Fläche heruntergerechnet.
   · 'Inter Tight' liegt nicht vor und wird wegen der DSGVO-Vorgabe
     (kein Google-CDN, siehe functions.php) nicht nachgeladen — stattdessen
     das vorhandene 'Inter' mit etwas engerer Laufweite.
   · Der Entwurf verschickt per mailto:; hier geht das Formular an den
     Server (siehe bsd-analyse.js + bsd_analyse_core() in functions.php).

   Eigene Klassen (.bd-analyse-*) — bewusst NICHT .bsd-exit-popup-*,
   .bsd-quiz-*, .f-input oder .btn-gold wiederverwendet: style.css
   erzwingt dort Hintergründe und Farben per !important.
   ═══════════════════════════════════════════════════════════════════ */

.bd-analyse {
  --bda-gold:     #E3B04B;
  --bda-gold-hi:  #F0C56A;
  --bda-gold-lo:  #DDA838;
  --bda-ink:      #0A0F1C;
  --bda-text:     #FFFFFF;
  --bda-soft:     rgba(226,232,245,0.62);
  --bda-faint:    rgba(226,232,245,0.5);

  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background: rgba(4, 5, 8, 0.72);
  -webkit-backdrop-filter: blur(6px);
          backdrop-filter: blur(6px);
  opacity: 0; pointer-events: none;
  transition: opacity .28s ease;
  font-family: 'Inter', system-ui, sans-serif;
  letter-spacing: -0.01em;   /* nähert Inter an das schmalere Inter Tight an */
  overflow-y: auto;
}
/* 07.08.2026: `visibility` ergänzt. Vorher schloss das Fenster nur über
   `opacity: 0` und `pointer-events: none` — seine fünf Bedienelemente blieben
   damit in der Tab-Folge. Am Seitenende landete der Fokus in einem
   unsichtbaren Formular, ohne dass der Nutzer erkennen konnte, wo er ist.
   Zusätzlich ist `aria-hidden="true"` über fokussierbaren Elementen selbst
   ein Fehler (WCAG 4.1.2).
   `visibility: hidden` nimmt Nachfahren aus der Tab-Folge, ohne den
   Ein- und Ausblendeffekt zu verlieren — dieselbe Lösung wie bei
   `#mob-menu[aria-hidden="true"]` in style.css und `.bsd-quiz-modal`,
   die beide sauber messen (0 von 19 Elementen fokussierbar). */
.bd-analyse { visibility: hidden; transition: opacity .28s ease, visibility 0s linear .28s; }
.bd-analyse.is-visible { opacity: 1; pointer-events: auto; visibility: visible; transition: opacity .28s ease, visibility 0s; }

/* Die Karte selbst. overflow bleibt sichtbar, weil die Warn-Badges des
   Entwurfs mit negativen Offsets aus dem Rahmen ragen. */
.bd-analyse-card {
  position: relative;
  width: 1040px; max-width: 100%;
  background: #07080A;
  border: 1px solid rgba(233,180,76,0.16);
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.55), inset 0 1px 0 rgba(233,180,76,0.14);
  transform: translateY(18px) scale(0.985);
  transition: transform .32s cubic-bezier(.2,.7,.2,1);
  margin: auto;
}
.bd-analyse.is-visible .bd-analyse-card { transform: translateY(0) scale(1); }

/* Hintergrund-Ebene: geclippt, damit Orbs und Partikel die runden Ecken
   nicht überlaufen. Die Karte selbst bleibt overflow:visible. */
.bd-analyse-bg {
  position: absolute; inset: 0; overflow: hidden;
  border-radius: inherit; pointer-events: none;
}
.bd-analyse-orb { position: absolute; border-radius: 50%; }
.bd-analyse-orb--gold {
  width: 460px; height: 460px; left: -120px; top: -160px;
  background: radial-gradient(closest-side, rgba(233,180,76,0.15), transparent);
  filter: blur(28px);
  animation: bdaqDrift 24s ease-in-out infinite;
}
.bd-analyse-orb--blue {
  width: 380px; height: 380px; right: -140px; bottom: -160px;
  background: radial-gradient(closest-side, rgba(90,150,255,0.13), transparent);
  filter: blur(34px);
  animation: bdaqDrift2 30s ease-in-out infinite;
}
/* Goldschimmer über der Mitte, wie im Entwurf */
.bd-analyse-glow {
  position: absolute; top: -120px; left: 45%;
  width: 420px; height: 320px; border-radius: 50%;
  background: radial-gradient(circle, rgba(233,180,76,0.10), transparent 65%);
}
.bd-analyse-particle {
  position: absolute; border-radius: 50%;
  animation: bdaqFloat 6s ease-in-out infinite;
}

/* Schließen */
/* Sitzt auf der Kartenecke, nicht innen: der Entwurf hat dort die
   Warn-Marke „⚠ Ladezeit 4,2 s" (top:-16px; right:-22px am Mockup) —
   innen läge der Knopf genau darunter. */
.bd-analyse-close {
  position: absolute; top: -14px; right: -14px; z-index: 8;
  width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(255,255,255,0.18);
  background: #0C1017;
  color: rgba(226,232,245,0.75);
  font-size: 20px; line-height: 1; cursor: pointer;
  box-shadow: 0 8px 22px rgba(0,0,0,0.6);
  transition: color .2s, border-color .2s, background .2s;
}
.bd-analyse-close:hover {
  color: var(--bda-gold-hi);
  border-color: rgba(233,180,76,0.5);
  background: rgba(233,180,76,0.1);
}

/* ── Innenraster (Entwurf 3a) ───────────────────────────────────── */
.bd-analyse-inner {
  position: relative;
  display: grid; grid-template-columns: 1fr 400px;
  gap: 44px; padding: 38px 48px; align-items: center;
}
.bd-analyse-copy { display: flex; flex-direction: column; gap: 14px; }

.bd-analyse-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.bd-analyse-eyebrow {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--bda-gold);
}
.bd-analyse-eyebrow i { width: 22px; height: 1px; background: var(--bda-gold); }
.bd-analyse-badge {
  display: inline-flex; align-items: center;
  font-family: 'Poppins', sans-serif; font-size: 12px; font-weight: 600;
  color: var(--bda-ink);
  background: linear-gradient(120deg, var(--bda-gold-hi), var(--bda-gold-lo));
  border-radius: 999px; padding: 4px 12px;
  animation: bdaqPulse 2.6s ease-out infinite;
}

.bd-analyse h2.bd-analyse-title {
  margin: 0; font-family: 'Poppins', sans-serif;
  font-size: 29px; line-height: 1.18; letter-spacing: -0.01em;
  font-weight: 700; color: var(--bda-text); text-wrap: pretty;
}
.bd-analyse h2.bd-analyse-title span { color: var(--bda-gold); }
.bd-analyse .bd-analyse-lead {
  margin: 0; font-size: 14px; line-height: 1.6;
  color: var(--bda-soft); max-width: 420px; text-wrap: pretty;
}

/* ── Formular ───────────────────────────────────────────────────── */
.bd-analyse-form { display: flex; flex-direction: column; gap: 10px; max-width: 430px; }
.bd-analyse-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.bd-analyse .bd-analyse-input {
  font-family: 'Inter', sans-serif; font-size: 14px;
  color: #F2F5FC;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 999px; padding: 11px 16px;
  outline: none; width: 100%; box-sizing: border-box;
  transition: border-color .2s, box-shadow .2s;
}
.bd-analyse .bd-analyse-input::placeholder { color: rgba(226,232,245,0.35); }
.bd-analyse .bd-analyse-input:focus,
.bd-analyse .bd-analyse-input:focus-visible {
  border-color: var(--bda-gold);
  box-shadow: 0 0 0 3px rgba(233,180,76,0.18);
}

.bd-analyse .bd-analyse-submit {
  position: relative; overflow: hidden;
  font-family: 'Poppins', sans-serif; font-size: 15px; font-weight: 600;
  color: var(--bda-ink);
  background: linear-gradient(120deg, var(--bda-gold-hi), var(--bda-gold-lo));
  border: none; border-radius: 999px; padding: 13px 20px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(233,180,76,0.28);
  transition: transform .15s, box-shadow .15s;
}
.bd-analyse .bd-analyse-submit:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 12px 34px rgba(233,180,76,0.45);
}
.bd-analyse .bd-analyse-submit:disabled { opacity: .7; cursor: default; }
.bd-analyse-sheen {
  position: absolute; top: 0; bottom: 0; left: -60%; width: 36%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,0.5), transparent);
  transform: skewX(-18deg);
  animation: bdaqSheen 4.5s ease infinite;
}
.bd-analyse-submit span:last-child { position: relative; }

/* Honeypot — für Menschen unsichtbar, für Bots verlockend */
.bd-analyse-hp {
  position: absolute !important; left: -9999px !important;
  width: 1px; height: 1px; overflow: hidden;
}

.bd-analyse-trust {
  display: flex; gap: 14px; flex-wrap: wrap;
  font-size: 12px; color: var(--bda-faint);
}
.bd-analyse-trust span { display: inline-flex; align-items: center; gap: 5px; }
.bd-analyse-trust b { color: var(--bda-gold); font-weight: 400; }

/* Rückmeldungen */
.bd-analyse-error {
  margin: 0; font-size: 13px; color: #FFB4A8;
  background: rgba(255,95,87,0.10);
  border: 1px solid rgba(255,95,87,0.35);
  border-radius: 12px; padding: 9px 14px;
}
.bd-analyse-note { margin: 0; font-size: 11.5px; color: rgba(226,232,245,0.38); }
.bd-analyse-note a { color: rgba(226,232,245,0.6); text-decoration: underline; }
.bd-analyse-note a:hover { color: var(--bda-gold-hi); }

.bd-analyse-success { display: none; flex-direction: column; gap: 12px; max-width: 430px; }
.bd-analyse.is-sent .bd-analyse-form,
.bd-analyse.is-sent .bd-analyse-trust { display: none; }
.bd-analyse.is-sent .bd-analyse-success { display: flex; }
.bd-analyse-success-icon {
  width: 46px; height: 46px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(233,180,76,0.12);
  border: 1px solid rgba(233,180,76,0.4);
  color: var(--bda-gold); font-size: 22px; font-weight: 700;
}
.bd-analyse-success p { margin: 0; font-size: 14px; line-height: 1.6; color: var(--bda-soft); }
.bd-analyse-success strong { color: var(--bda-text); font-weight: 600; }

/* ── 3D-Mockup ──────────────────────────────────────────────────── */
.bd-analyse-stage { perspective: 900px; }
.bd-analyse-tilt {
  position: relative; transform-style: preserve-3d;
  transition: transform .25s ease-out;
}
.bd-analyse-idle { transform-style: preserve-3d; animation: bdaqIdle 9s ease-in-out infinite; }

.bd-analyse-browser {
  position: relative; background: #0E1526;
  border: 1px solid rgba(233,180,76,0.22); border-radius: 14px;
  box-shadow: 0 28px 56px rgba(0,0,0,0.55), 0 0 40px rgba(233,180,76,0.07);
  overflow: hidden;
}
.bd-analyse-bar {
  display: flex; align-items: center; gap: 7px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  background: rgba(255,255,255,0.03);
}
.bd-analyse-bar i { width: 8px; height: 8px; border-radius: 50%; }
.bd-analyse-bar i:nth-child(1) { background: #FF5F57; }
.bd-analyse-bar i:nth-child(2) { background: #FEBC2E; }
.bd-analyse-bar i:nth-child(3) { background: #28C840; }
.bd-analyse-bar span {
  margin-left: 8px; flex: 1; font-size: 11px;
  color: var(--bda-faint);
  background: rgba(255,255,255,0.05);
  border-radius: 999px; padding: 4px 12px;
}
.bd-analyse-screen {
  position: relative; height: 230px; padding: 16px;
  display: flex; flex-direction: column; gap: 10px; overflow: hidden;
}
.bd-analyse-block {
  height: 80px; border-radius: 8px;
  background: linear-gradient(120deg, rgba(233,180,76,0.13), rgba(255,255,255,0.05));
  animation: bdaqShimmer 3s ease-in-out infinite;
}
.bd-analyse-bars { display: flex; gap: 10px; align-items: flex-end; height: 52px; }
.bd-analyse-bars i {
  flex: 1; border-radius: 8px; transform-origin: bottom;
  background: rgba(255,255,255,0.05);
  animation: bdaqBarGrow 5s ease infinite;
}
.bd-analyse-bars i:nth-child(1) { height: 100%; }
.bd-analyse-bars i:nth-child(2) { height: 70%; animation-delay: .4s; }
.bd-analyse-bars i:nth-child(3) {
  height: 45%;
  background: rgba(255,95,87,0.18); border: 1px solid rgba(255,95,87,0.35);
  animation: bdaqBarGrow 5s ease .8s infinite, bdaqBlink 4s linear infinite;
}
.bd-analyse-line { height: 10px; border-radius: 5px; }
.bd-analyse-line--a { width: 70%; background: rgba(255,255,255,0.07); }
.bd-analyse-line--b { width: 48%; background: rgba(255,255,255,0.05); }
.bd-analyse-scan {
  position: absolute; left: 0; right: 0; top: 0; height: 70px;
  background: linear-gradient(180deg, transparent, rgba(233,180,76,0.14) 55%,
              rgba(240,197,106,0.55) 99%, transparent);
  border-bottom: 1px solid var(--bda-gold-hi);
  animation: bdaqScan 5s cubic-bezier(.5,0,.5,1) infinite;
  pointer-events: none;
}
.bd-analyse-glare {
  position: absolute; inset: 0; opacity: 0;
  transition: opacity .3s; pointer-events: none;
}

/* Schwebende Warn-Marken — ragen bewusst aus dem Rahmen */
.bd-analyse-flag {
  position: absolute; display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; font-weight: 600;
  border-radius: 999px; padding: 6px 12px;
  box-shadow: 0 12px 28px rgba(0,0,0,0.45);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  white-space: nowrap;
}
.bd-analyse-flag--speed {
  top: -16px; right: -22px;
  color: #FFB4A8; background: rgba(30,14,16,0.85);
  border: 1px solid rgba(255,95,87,0.45);
  animation: bdaqHover3d 5s ease-in-out infinite;
}
.bd-analyse-flag--rank {
  bottom: 52px; right: -30px;
  color: #FFD58A; background: rgba(26,20,10,0.85);
  border: 1px solid rgba(254,188,46,0.45);
  animation: bdaqDrop 4s ease-in-out infinite;
}
.bd-analyse-score {
  position: absolute; bottom: -26px; left: -26px;
  width: 88px; height: 88px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(12,17,30,0.9);
  border: 1px solid rgba(233,180,76,0.3);
  box-shadow: 0 14px 32px rgba(0,0,0,0.5);
  animation: bdaqHover3d 6s ease-in-out 1s infinite;
}
.bd-analyse-score svg { transform: rotate(-90deg); }
.bd-analyse-score circle:last-child { animation: bdaqScore 5s ease infinite; }
.bd-analyse-score-val {
  position: absolute; display: flex; flex-direction: column; align-items: center;
  font-family: 'Poppins', sans-serif;
}
.bd-analyse-score-val b { font-size: 17px; font-weight: 700; color: var(--bda-gold); line-height: 1; }
.bd-analyse-score-val i {
  font-size: 8px; font-style: normal; letter-spacing: 0.1em;
  text-transform: uppercase; color: rgba(226,232,245,0.55);
}

/* ══════════════════════════════════════════════════════════════════
   MOBIL — Entwurf 4a (390 px, gestapelt)
   ══════════════════════════════════════════════════════════════════ */
@media (max-width: 1023px) {
  .bd-analyse { padding: 16px; align-items: flex-start; }
  .bd-analyse-card { width: 390px; border-radius: 18px; margin: 22px auto 16px; }
  .bd-analyse-close { top: -12px; right: -6px; width: 34px; height: 34px; font-size: 18px; }

  .bd-analyse-orb--gold { width: 300px; height: 300px; left: -80px; top: -110px; filter: blur(24px); }
  .bd-analyse-orb--blue { width: 260px; height: 260px; right: -100px; bottom: -120px; filter: blur(28px); }
  .bd-analyse-glow { top: -100px; left: 30%; width: 300px; height: 240px; }

  /* Reihenfolge wie im Entwurf 4a: Kopf, Mockup, Formular */
  .bd-analyse-inner {
    display: flex; flex-direction: column; gap: 16px;
    padding: 28px 22px 26px;
  }
  .bd-analyse-copy { gap: 16px; }
  .bd-analyse-stage { order: -1; perspective: 800px; padding: 6px 14px 30px 20px; }

  .bd-analyse-eyebrow { font-size: 10.5px; letter-spacing: 0.13em; }
  .bd-analyse-eyebrow i { width: 18px; }
  .bd-analyse-badge { font-size: 11.5px; padding: 4px 11px; }
  .bd-analyse h2.bd-analyse-title { font-size: 24px; line-height: 1.2; }
  .bd-analyse .bd-analyse-lead { font-size: 14px; line-height: 1.55; max-width: none; }

  .bd-analyse-form, .bd-analyse-success { max-width: none; }
  .bd-analyse-row { grid-template-columns: 1fr; }
  /* 16 px verhindert das automatische Hineinzoomen unter iOS */
  .bd-analyse .bd-analyse-input { font-size: 16px; padding: 13px 18px; }
  .bd-analyse .bd-analyse-submit { font-size: 15px; padding: 15px 20px; }
  .bd-analyse .bd-analyse-submit:hover { transform: none; }
  .bd-analyse-trust { gap: 10px 14px; }

  .bd-analyse-browser { border-radius: 12px; }
  .bd-analyse-bar { padding: 9px 12px; gap: 6px; }
  .bd-analyse-bar i { width: 7px; height: 7px; }
  .bd-analyse-bar span { margin-left: 6px; font-size: 10px; padding: 3px 10px; }
  .bd-analyse-screen { height: 150px; padding: 12px; gap: 8px; }
  .bd-analyse-block { height: 54px; border-radius: 7px; }
  .bd-analyse-bars { height: 38px; gap: 8px; }
  .bd-analyse-bars i { border-radius: 6px; }
  .bd-analyse-line { height: 8px; border-radius: 4px; }
  .bd-analyse-line--b { display: none; }
  .bd-analyse-scan { height: 50px; }

  .bd-analyse-flag { font-size: 10.5px; padding: 5px 10px; gap: 5px; }
  .bd-analyse-flag--speed { top: -13px; right: -10px; }
  .bd-analyse-flag--rank  { bottom: 34px; right: -13px; }
  .bd-analyse-score { width: 68px; height: 68px; bottom: -22px; left: -14px; }
  .bd-analyse-score svg { width: 56px; height: 56px; }
  .bd-analyse-score-val b { font-size: 14px; }
  .bd-analyse-score-val i { font-size: 7px; }
}

@media (max-width: 420px) {
  .bd-analyse { padding: 10px; }
  .bd-analyse-card { width: 100%; }
  .bd-analyse-flag--speed { right: -4px; }
  .bd-analyse-flag--rank  { right: -6px; }
  .bd-analyse-score { left: -8px; }
}

/* ── Keyframes (Präfix bdaq, damit nichts mit bda*/bdh* kollidiert) ── */
@keyframes bdaqFloat   { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-18px); } }
@keyframes bdaqScan    { 0% { transform: translateY(-120px); } 55%, 100% { transform: translateY(360px); } }
@keyframes bdaqPulse   { 0%   { box-shadow: 0 0 0 0 rgba(233,180,76,0.5); }
                         70%  { box-shadow: 0 0 0 12px rgba(233,180,76,0); }
                         100% { box-shadow: 0 0 0 0 rgba(233,180,76,0); } }
@keyframes bdaqShimmer { 0% { opacity: .5; } 50% { opacity: 1; } 100% { opacity: .5; } }
@keyframes bdaqScore   { 0%, 15% { stroke-dashoffset: 163; } 55%, 100% { stroke-dashoffset: 64; } }
@keyframes bdaqDrop    { 0%, 100% { transform: translateZ(46px) translateY(0); }
                         50%      { transform: translateZ(46px) translateY(7px); } }
@keyframes bdaqHover3d { 0%, 100% { transform: translateZ(40px) translateY(0); }
                         50%      { transform: translateZ(40px) translateY(-8px); } }
@keyframes bdaqBlink   { 0%, 88%, 100% { opacity: 1; } 92%, 96% { opacity: .25; } }
@keyframes bdaqBarGrow { 0%, 10% { transform: scaleY(0.15); } 60%, 100% { transform: scaleY(1); } }
@keyframes bdaqIdle    { 0%, 100% { transform: rotateY(-7deg) rotateX(3deg) translateY(0); }
                         50%      { transform: rotateY(-3deg) rotateX(1.5deg) translateY(-7px); } }
@keyframes bdaqSheen   { 0%, 55% { left: -60%; } 85%, 100% { left: 130%; } }
@keyframes bdaqDrift   { 0%, 100% { transform: translate3d(0,0,0) scale(1); }
                         33%      { transform: translate3d(40px,-26px,0) scale(1.12); }
                         66%      { transform: translate3d(-32px,20px,0) scale(0.94); } }
@keyframes bdaqDrift2  { 0%, 100% { transform: translate3d(0,0,0) scale(1.05); }
                         50%      { transform: translate3d(-50px,26px,0) scale(0.9); } }

/* ── Reduzierte Bewegung ────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .bd-analyse, .bd-analyse * , .bd-analyse *::before, .bd-analyse *::after {
    animation: none !important;
    transition-duration: .01ms !important;
  }
  .bd-analyse-card { transform: none; }
}
