/* ============================================
   Global Styles — Sparen mit Gronert
   Modern UX/Visual Overhaul
   ============================================ */

/* --- Custom Properties (Design Tokens) --- */
:root {
  --color-primary: #0d6efd;
  --color-primary-dark: #0a58ca;
  --color-primary-light: #6ea8fe;
  --color-accent: #6f42c1;
  --color-accent-light: #a78bfa;
  --color-surface: #ffffff;
  --color-surface-alt: #f8f9fa;
  --color-dark: #0f172a;
  --color-dark-alt: #1e293b;
  --color-text: #1a1a2e;
  --color-text-muted: #64748b;
  --gradient-primary: linear-gradient(135deg, #0d6efd 0%, #6f42c1 100%);
  --gradient-dark: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  --gradient-hero: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --gradient-accent-line: linear-gradient(90deg, #0d6efd, #6f42c1, #ec4899, #0d6efd);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.12);
  --shadow-glow: 0 0 30px rgba(13, 110, 253, 0.15);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
  --transition-slow: 0.4s ease;
  --font-display: 'Roboto', system-ui, sans-serif;
}

/* --- Smooth Scroll --- */
html {
  scroll-behavior: smooth;
}

/* --- Custom Scrollbar --- */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--color-surface-alt);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--color-primary), var(--color-accent));
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, var(--color-primary-dark), var(--color-accent));
}

/* Firefox scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--color-primary) var(--color-surface-alt);
}

/* --- Typography Scale --- */
body {
  font-family: var(--font-display);
  color: var(--color-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(2rem, 5vw, 3rem); }
h2 { font-size: clamp(1.6rem, 4vw, 2.4rem); }
h3 { font-size: clamp(1.3rem, 3vw, 1.8rem); }

/* --- Global Card & Button Hover Effects --- */
.card {
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
  border-radius: var(--radius-md) !important;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.btn {
  transition: all var(--transition-normal);
  border-radius: var(--radius-sm);
  font-weight: 500;
  letter-spacing: 0.01em;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: var(--gradient-primary);
  border: none;
  box-shadow: 0 4px 15px rgba(13, 110, 253, 0.3);
}

.btn-primary:hover {
  box-shadow: 0 6px 25px rgba(13, 110, 253, 0.4);
  background: linear-gradient(135deg, #0a58ca 0%, #5a32a3 100%);
}

/* --- Glassmorphism Utility --- */
.glass {
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-md);
}

/* --- Form Styling --- */
.form-control,
.form-select {
  border-radius: var(--radius-sm);
  border: 2px solid #e2e8f0;
  padding: 0.65rem 1rem;
  transition: border-color var(--transition-normal), box-shadow var(--transition-normal);
  font-size: 1rem;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.12), 0 0 20px rgba(13, 110, 253, 0.06);
  outline: none;
}

.form-control::placeholder {
  color: #94a3b8;
  font-weight: 300;
}

/* --- Fade-In Animation Class --- */
.fade-in {
  animation: fadeInUp 0.6s ease both;
}

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

/* Staggered fade-in for children */
.fade-in-stagger > *:nth-child(1) { animation-delay: 0s; }
.fade-in-stagger > *:nth-child(2) { animation-delay: 0.1s; }
.fade-in-stagger > *:nth-child(3) { animation-delay: 0.2s; }
.fade-in-stagger > *:nth-child(4) { animation-delay: 0.3s; }
.fade-in-stagger > *:nth-child(5) { animation-delay: 0.4s; }
.fade-in-stagger > *:nth-child(6) { animation-delay: 0.5s; }

/* --- Animated Gradient Background --- */
.gradient-bg-animated {
  background: linear-gradient(-45deg, #0d6efd, #6f42c1, #0d6efd, #6f42c1);
  background-size: 400% 400%;
  animation: gradientShift 8s ease infinite;
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* --- Gradient Text Utility --- */
.gradient-text {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* --- Pulse Animation --- */
@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 4px 15px rgba(13, 110, 253, 0.3);
  }
  50% {
    box-shadow: 0 4px 30px rgba(13, 110, 253, 0.5), 0 0 60px rgba(13, 110, 253, 0.15);
  }
}

.pulse {
  animation: pulse-glow 2.5s ease-in-out infinite;
}

/* --- Route Transition --- */
.route-fade-enter-active,
.route-fade-leave-active {
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.route-fade-enter-from {
  opacity: 0;
  transform: translateY(10px);
}

.route-fade-leave-to {
  opacity: 0;
  transform: translateY(-10px);
}

/* --- Floating Particles --- */
@keyframes float-particle {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
    opacity: 0.4;
  }
  25% {
    transform: translateY(-30px) rotate(90deg);
    opacity: 0.7;
  }
  50% {
    transform: translateY(-15px) rotate(180deg);
    opacity: 0.5;
  }
  75% {
    transform: translateY(-40px) rotate(270deg);
    opacity: 0.6;
  }
}

.floating-particle {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  animation: float-particle 6s ease-in-out infinite;
}

/* --- Section Divider --- */
.section-divider {
  height: 4px;
  background: var(--gradient-accent-line);
  background-size: 300% 100%;
  animation: gradientSlide 4s linear infinite;
  border: none;
  margin: 0;
}

@keyframes gradientSlide {
  0% { background-position: 0% 0%; }
  100% { background-position: 300% 0%; }
}

/* --- Badge Enhancement --- */
.badge {
  font-weight: 500;
  letter-spacing: 0.02em;
  border-radius: 50px;
}

/* --- Scroll-triggered fade (used with IntersectionObserver) --- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- Animated Gradient Border --- */
.gradient-border {
  position: relative;
  border-radius: var(--radius-md) !important;
  overflow: hidden;
}

.gradient-border::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 2px;
  background: linear-gradient(135deg, #0d6efd, #6f42c1, #ec4899, #0d6efd);
  background-size: 300% 300%;
  animation: gradientShift 4s ease infinite;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  z-index: 1;
}

/* --- Floating Label Effect --- */
.floating-label {
  position: relative;
}

.floating-label .form-control {
  padding-top: 1.5rem;
  padding-bottom: 0.5rem;
}

.floating-label .form-label {
  position: absolute;
  top: 50%;
  left: 1rem;
  transform: translateY(-50%);
  transition: all var(--transition-normal);
  pointer-events: none;
  color: #94a3b8;
  font-weight: 400;
  margin-bottom: 0;
  z-index: 2;
}

.floating-label .form-control:focus ~ .form-label,
.floating-label .form-control:not(:placeholder-shown) ~ .form-label {
  top: 0.5rem;
  transform: translateY(0);
  font-size: 0.75rem;
  color: var(--color-primary);
  font-weight: 600;
}

.floating-label textarea.form-control ~ .form-label {
  top: 1rem;
  transform: none;
}

.floating-label textarea.form-control:focus ~ .form-label,
.floating-label textarea.form-control:not(:placeholder-shown) ~ .form-label {
  top: 0.3rem;
  font-size: 0.75rem;
  color: var(--color-primary);
  font-weight: 600;
}

/* --- Counter Badge --- */
.counter-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--gradient-primary);
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  box-shadow: 0 2px 8px rgba(13, 110, 253, 0.3);
}

/* --- Selection color --- */
::selection {
  background: rgba(13, 110, 253, 0.2);
  color: inherit;
}

/* ============================================
   Advanced Animations & Effects
   ============================================ */

/* --- Shimmer / Skeleton Loading --- */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.shimmer {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
}

/* --- Tilt on Hover (subtle 3D) --- */
.tilt-hover {
  transition: transform 0.3s ease;
  transform-style: preserve-3d;
  perspective: 1000px;
}

.tilt-hover:hover {
  transform: perspective(1000px) rotateX(2deg) rotateY(-2deg) translateY(-6px);
  box-shadow: 8px 8px 30px rgba(0, 0, 0, 0.12), -2px -2px 10px rgba(255, 255, 255, 0.05);
}

/* --- Magnetic Button Effect --- */
.btn-magnetic {
  position: relative;
  overflow: hidden;
}

.btn-magnetic::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transition: width 0.5s ease, height 0.5s ease, top 0.5s ease, left 0.5s ease;
  transform: translate(-50%, -50%);
}

.btn-magnetic:hover::after {
  width: 300px;
  height: 300px;
}

/* --- Glow Ring on Focus --- */
.glow-ring:focus-within {
  box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.15),
              0 0 20px rgba(13, 110, 253, 0.08),
              0 0 40px rgba(111, 66, 193, 0.05);
}

/* --- Typewriter cursor blink --- */
@keyframes blink-cursor {
  0%, 100% { border-right-color: transparent; }
  50% { border-right-color: currentColor; }
}

.typewriter-cursor {
  border-right: 3px solid;
  animation: blink-cursor 0.8s step-end infinite;
  padding-right: 4px;
}

/* --- Slide-In from sides --- */
@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-40px); }
  to { opacity: 1; transform: translateX(0); }
}

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

.slide-left { animation: slideInLeft 0.6s ease both; }
.slide-right { animation: slideInRight 0.6s ease both; }

/* --- Scale Bounce Entry --- */
@keyframes scaleBounce {
  0% { opacity: 0; transform: scale(0.3); }
  50% { opacity: 1; transform: scale(1.05); }
  70% { transform: scale(0.95); }
  100% { transform: scale(1); }
}

.scale-bounce {
  animation: scaleBounce 0.5s ease both;
}

/* --- Neon Glow Text --- */
.neon-text {
  text-shadow: 0 0 7px rgba(13, 110, 253, 0.5),
               0 0 20px rgba(13, 110, 253, 0.3),
               0 0 42px rgba(13, 110, 253, 0.15);
}

/* --- Morphing Blob Background --- */
@keyframes morphBlob {
  0%, 100% { border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; }
  25% { border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%; }
  50% { border-radius: 50% 60% 30% 60% / 30% 50% 70% 50%; }
  75% { border-radius: 40% 60% 50% 40% / 60% 30% 60% 40%; }
}

.morph-blob {
  animation: morphBlob 8s ease-in-out infinite;
}

/* --- Tooltip glow --- */
.badge-glow {
  position: relative;
}

.badge-glow::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  background: inherit;
  filter: blur(8px);
  opacity: 0.4;
  z-index: -1;
}

/* --- Stagger from bottom for lists --- */
@keyframes riseUp {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.rise-stagger > *:nth-child(1) { animation: riseUp 0.4s ease 0.05s both; }
.rise-stagger > *:nth-child(2) { animation: riseUp 0.4s ease 0.12s both; }
.rise-stagger > *:nth-child(3) { animation: riseUp 0.4s ease 0.19s both; }
.rise-stagger > *:nth-child(4) { animation: riseUp 0.4s ease 0.26s both; }
.rise-stagger > *:nth-child(5) { animation: riseUp 0.4s ease 0.33s both; }
.rise-stagger > *:nth-child(6) { animation: riseUp 0.4s ease 0.40s both; }

/* --- Underline expand on hover --- */
.hover-underline {
  position: relative;
  text-decoration: none !important;
}

.hover-underline::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--gradient-primary);
  border-radius: 2px;
  transition: width 0.3s ease;
}

.hover-underline:hover::after {
  width: 100%;
}

/* --- Icon Spin on Hover --- */
.icon-spin-hover:hover i,
.icon-spin-hover:hover .fa,
.icon-spin-hover:hover .fas {
  animation: iconSpin 0.5s ease;
}

@keyframes iconSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* --- Ripple click effect --- */
.ripple {
  position: relative;
  overflow: hidden;
}

.ripple::before {
  content: '';
  position: absolute;
  top: var(--ripple-y, 50%);
  left: var(--ripple-x, 50%);
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  transform: translate(-50%, -50%);
  transition: width 0.6s ease, height 0.6s ease, opacity 0.6s ease;
  opacity: 0;
}

.ripple:active::before {
  width: 300px;
  height: 300px;
  opacity: 1;
  transition: 0s;
}

/* --- Parallax subtle on scroll (CSS only) --- */
.parallax-slow {
  will-change: transform;
  transition: transform 0.1s linear;
}

/* --- Success confetti burst (for form submit) --- */
@keyframes confettiBurst {
  0% { opacity: 1; transform: scale(0.5) rotate(0deg); }
  50% { opacity: 0.8; transform: scale(1.2) rotate(180deg); }
  100% { opacity: 0; transform: scale(1.5) rotate(360deg) translateY(-30px); }
}

/* --- Alert slide-in --- */
@keyframes alertSlideIn {
  from { opacity: 0; transform: translateY(-10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.alert {
  animation: alertSlideIn 0.35s ease both;
}

/* --- Breadcrumb fade --- */
.breadcrumb {
  animation: fadeInUp 0.3s ease both;
}

.breadcrumb-item + .breadcrumb-item::before {
  color: var(--color-primary);
}

/* --- Link arrow animation --- */
.link-arrow::after {
  content: ' \2192';
  display: inline-block;
  transition: transform 0.2s ease;
}

.link-arrow:hover::after {
  transform: translateX(4px);
}

/* --- Number counter shimmer --- */
.number-highlight {
  display: inline-block;
  background: linear-gradient(90deg, currentColor 40%, rgba(13,110,253,0.5) 50%, currentColor 60%);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 3s linear infinite;
}

/* --- Smooth accordion with icon rotation --- */
.accordion-button::after {
  transition: transform 0.3s ease;
}

/* --- Focus visible for accessibility --- */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* --- Responsive polish --- */
@media (max-width: 768px) {
  .hero-section {
    min-height: 90vh;
  }

  h1 { font-size: clamp(1.6rem, 6vw, 2.2rem); }

  .trust-item {
    min-width: 90px !important;
    padding: 0.4rem 0.6rem !important;
  }

  .partner-logos {
    display: none !important;
  }

  .step-connector {
    width: 30px !important;
  }
}
