/* RecurFix - premium motion + chart primitives */
:root {
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --glow: 0 0 80px rgba(16, 185, 129, 0.12);
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
}

.glass {
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.06) 0%,
    rgba(255, 255, 255, 0.02) 100%
  );
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.glass-strong {
  background: linear-gradient(
    145deg,
    rgba(24, 24, 27, 0.85) 0%,
    rgba(9, 9, 11, 0.92) 100%
  );
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.mesh-gradient {
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(16, 185, 129, 0.15), transparent),
    radial-gradient(ellipse 60% 40% at 100% 0%, rgba(59, 130, 246, 0.08), transparent),
    radial-gradient(ellipse 50% 30% at 0% 100%, rgba(168, 85, 247, 0.06), transparent);
}

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

@keyframes float-slow {
  0%,
  100% {
    transform: translateY(0) rotate(-0.5deg);
  }
  50% {
    transform: translateY(-12px) rotate(0.5deg);
  }
}

@keyframes pulse-ring {
  0% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.35);
  }
  70% {
    box-shadow: 0 0 0 12px rgba(16, 185, 129, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

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

@keyframes dash-flow {
  to {
    stroke-dashoffset: 0;
  }
}

.animate-float {
  animation: float-y 5s ease-in-out infinite;
}

.animate-float-slow {
  animation: float-slow 8s ease-in-out infinite;
}

.animate-pulse-ring {
  animation: pulse-ring 2.5s ease-out infinite;
}

.shimmer-bar {
  background: linear-gradient(
    90deg,
    rgba(16, 185, 129, 0.15) 0%,
    rgba(16, 185, 129, 0.45) 50%,
    rgba(16, 185, 129, 0.15) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 3s linear infinite;
}

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity 0.7s var(--ease-out-expo),
    transform 0.7s var(--ease-out-expo);
}

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

.reveal-delay-1 {
  transition-delay: 0.08s;
}
.reveal-delay-2 {
  transition-delay: 0.16s;
}
.reveal-delay-3 {
  transition-delay: 0.24s;
}
.reveal-delay-4 {
  transition-delay: 0.32s;
}
.reveal-delay-5 {
  transition-delay: 0.4s;
}

.flow-step-pulse {
  animation: pulse-ring 2.5s ease-out infinite;
}

.timeline-line {
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.5), rgba(59, 130, 246, 0.3));
}

.chart-bar {
  transform-origin: bottom;
  transform: scaleY(0);
  transition: transform 0.9s var(--ease-out-expo);
}

.chart-bar.is-visible {
  transform: scaleY(1);
}

/* Flow step connector */
.flow-connector {
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.4), rgba(59, 130, 246, 0.3));
  height: 2px;
  border-radius: 999px;
}

/* Skip link */
.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
  width: auto;
  height: auto;
  padding: 0.5rem 1rem;
  background: #10b981;
  color: #020617;
  z-index: 100;
  border-radius: 0.375rem;
}

/* Form result modal */
.form-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s var(--ease-out-expo), visibility 0.25s;
}

.form-modal.is-open {
  opacity: 1;
  visibility: visible;
}

.form-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(9, 9, 11, 0.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.form-modal__dialog {
  position: relative;
  width: 100%;
  max-width: 26rem;
  transform: scale(0.94) translateY(12px);
  transition: transform 0.35s var(--ease-out-expo);
  border-radius: 1.25rem;
  padding: 2rem 1.75rem 1.5rem;
  text-align: center;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.06),
    0 24px 80px rgba(0, 0, 0, 0.55),
    var(--glow);
}

.form-modal.is-open .form-modal__dialog {
  transform: scale(1) translateY(0);
}

.form-modal--success .form-modal__dialog {
  background: linear-gradient(
    165deg,
    rgba(24, 24, 27, 0.95) 0%,
    rgba(9, 9, 11, 0.98) 55%,
    rgba(6, 78, 59, 0.15) 100%
  );
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.form-modal--error .form-modal__dialog {
  background: linear-gradient(
    165deg,
    rgba(24, 24, 27, 0.95) 0%,
    rgba(9, 9, 11, 0.98) 100%
  );
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.form-modal__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 4rem;
  height: 4rem;
  margin: 0 auto 1.25rem;
  border-radius: 1rem;
}

.form-modal--success .form-modal__icon {
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  box-shadow: 0 0 40px rgba(16, 185, 129, 0.2);
  animation: pulse-ring 2s ease-out infinite;
}

.form-modal--error .form-modal__icon {
  background: rgba(239, 68, 68, 0.1);
  color: #f87171;
}

.form-modal__title {
  margin: 0 0 0.75rem;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
  line-height: 1.3;
}

.form-modal__message {
  margin: 0 0 1.5rem;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: #a1a1aa;
}

.form-modal--success .form-modal__message {
  color: #d4d4d8;
}

.form-modal__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 8rem;
  padding: 0.625rem 1.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 0.5rem;
  border: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}

.form-modal--success .form-modal__close {
  background: #10b981;
  color: #09090b;
  box-shadow: 0 4px 24px rgba(16, 185, 129, 0.35);
}

.form-modal--success .form-modal__close:hover {
  background: #34d399;
  transform: translateY(-1px);
}

.form-modal--error .form-modal__close {
  background: rgba(255, 255, 255, 0.08);
  color: #fafafa;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.form-modal--error .form-modal__close:hover {
  background: rgba(255, 255, 255, 0.12);
}

.form-modal__dismiss {
  position: absolute;
  top: 0.875rem;
  right: 0.875rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: none;
  border-radius: 0.5rem;
  background: transparent;
  color: #71717a;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}

.form-modal__dismiss:hover {
  color: #e4e4e7;
  background: rgba(255, 255, 255, 0.06);
}
