/* ==============================================
   ZeugnisKlar – Animationen & Transitions
   ============================================== */

/* --- Keyframes --- */

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.92);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.05); }
}

@keyframes shimmer {
  0%   { background-position: -200% center; }
  100% { background-position: 200% center; }
}

@keyframes drawRing {
  from { stroke-dashoffset: 163; }
  to   { stroke-dashoffset: var(--ring-offset, 163); }
}

@keyframes floatY {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(-8px); }
}

@keyframes checkmark {
  0%   { stroke-dashoffset: 50; }
  100% { stroke-dashoffset: 0; }
}

/* --- Scroll-Trigger Klassen --- */

/* Elemente mit dieser Klasse starten unsichtbar */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

/* Wenn JS die Klasse .visible hinzufügt, wird animiert */
.animate-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Gestaffelte Verzögerungen für Kinder */
.animate-on-scroll:nth-child(2) { transition-delay: 0.08s; }
.animate-on-scroll:nth-child(3) { transition-delay: 0.16s; }
.animate-on-scroll:nth-child(4) { transition-delay: 0.24s; }

/* --- Hero Animationen --- */

.hero-content-anim {
  animation: fadeInUp 0.7s ease both;
}
.hero-eyebrow { animation-delay: 0.1s; }
.hero h1      { animation-delay: 0.2s; }
.hero-sub     { animation-delay: 0.3s; }
.hero-meta    { animation-delay: 0.4s; }
.hero-cta     { animation-delay: 0.5s; }

.hero-mockup-anim {
  animation: slideInRight 0.8s ease 0.3s both;
}

/* --- Karten-Einblendung --- */

.card {
  animation: fadeInUp 0.4s ease both;
}
.card:nth-child(2) { animation-delay: 0.05s; }
.card:nth-child(3) { animation-delay: 0.10s; }
.card:nth-child(4) { animation-delay: 0.15s; }
.card:nth-child(5) { animation-delay: 0.20s; }

/* Schritt-Transition */
.step-card-enter {
  animation: scaleIn 0.3s ease both;
}
.step-card-leave {
  animation: fadeIn 0.2s ease reverse both;
}

/* --- Button Effekte --- */

.btn {
  transition: background 0.18s ease, border-color 0.18s ease,
              box-shadow 0.18s ease, transform 0.12s ease, color 0.18s ease;
}
.btn:hover  { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

/* Submit-Button Pulse beim Hover */
.btn-primary:hover {
  box-shadow: 0 4px 16px rgba(5,150,105,.35);
}

/* --- Form-Control Focus --- */

.form-control {
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

/* --- Score-Ring Transition --- */

#quality_ring_fill {
  transition: stroke-dashoffset 0.6s cubic-bezier(0.4,0,0.2,1),
              stroke 0.4s ease;
}

/* --- Traffic Badge Transition --- */

.traffic-badge {
  transition: background 0.3s ease, color 0.3s ease;
}

/* --- Hero Mockup Float --- */

.hero-mockup-float {
  animation: floatY 4s ease-in-out infinite;
}

/* --- Shimmer für Lade-Skeleton --- */

.shimmer {
  background: linear-gradient(
    90deg,
    var(--color-border) 0%,
    #f3f4f6 50%,
    var(--color-border) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

/* --- Step Indicator Transition --- */

.step-dot {
  transition: background 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}
.step-dot.active {
  transform: scale(1.2);
}

/* --- Preview Panel --- */

.preview-panel {
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.preview-panel.hidden {
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
}

/* --- Check Result Einblendung --- */

.check-result:not([hidden]) {
  animation: fadeInUp 0.3s ease both;
}

/* --- Navbar Scroll-Shadow --- */

.navbar.scrolled {
  box-shadow: 0 2px 12px rgba(0,0,0,.10);
  transition: box-shadow 0.3s ease;
}

/* --- Focus-Sichtbarkeit --- */

:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}
