:root {
  --ease-apple: cubic-bezier(0.4, 0.0, 0.2, 1);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-out: cubic-bezier(0.0, 0.0, 0.2, 1);
  --duration-fast: 200ms;
  --duration-base: 300ms;
  --duration-slow: 600ms;
  --duration-slower: 900ms;
}

/* ── Keyframes ── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(32px); }
  to   { opacity: 1; transform: translateY(0); }
}

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

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

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

@keyframes pulse-ring {
  0%   { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(1.4); opacity: 0; }
}

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

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

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Entry animations ── */
.anim-fade-in {
  animation: fadeIn var(--duration-slow) var(--ease-apple) both;
}

.anim-fade-in-up {
  animation: fadeInUp var(--duration-slow) var(--ease-apple) both;
}

.anim-scale-in {
  animation: scaleIn var(--duration-base) var(--ease-bounce) both;
}

/* Staggered delays */
.delay-1 { animation-delay: 100ms; }
.delay-2 { animation-delay: 200ms; }
.delay-3 { animation-delay: 350ms; }
.delay-4 { animation-delay: 500ms; }
.delay-5 { animation-delay: 700ms; }

/* ── Scroll reveal ── */
.scroll-reveal {
  opacity: 0;
  transform: translateY(40px);
  transition:
    opacity var(--duration-slow) var(--ease-apple),
    transform var(--duration-slow) var(--ease-apple);
  transition-delay: var(--reveal-delay, 0ms);
}

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

/* ── Form field reveal (height transition) ── */
.field-reveal {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition:
    max-height 0.45s var(--ease-apple),
    opacity 0.3s var(--ease-apple),
    margin-top 0.3s var(--ease-apple);
  margin-top: 0;
}

.field-reveal.show {
  max-height: 320px;
  opacity: 1;
  margin-top: 12px;
}

/* ── Button states ── */
.btn-loading {
  position: relative;
  pointer-events: none;
  color: transparent !important;
}

.btn-loading::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  top: 50%;
  left: 50%;
  margin: -9px 0 0 -9px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
}

/* ── Toast / feedback ── */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: #1d1d1f;
  color: #fff;
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  pointer-events: none;
  transition: transform 0.35s var(--ease-bounce), opacity 0.35s;
  opacity: 0;
  z-index: 9999;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.toast.error { background: #ff3b30; }
.toast.success { background: #30d158; color: #000; }

/* ── Hero visual float ── */
.hero-badge {
  animation: float 4s ease-in-out infinite;
}

/* ── Gradient shimmer for hero ── */
.gradient-text {
  background: linear-gradient(135deg, #fff 0%, #a1a1a6 50%, #fff 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 4s linear infinite;
}

/* ── Parallax container ── */
.parallax {
  will-change: transform;
}

/* ── Input focus ring ── */
.input-focus-ring {
  transition:
    box-shadow var(--duration-base) var(--ease-apple),
    border-color var(--duration-base) var(--ease-apple);
}

.input-focus-ring:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.25);
  border-color: #0071e3;
}

/* ── Card hover ── */
.card-hover {
  transition: transform var(--duration-base) var(--ease-apple),
              box-shadow var(--duration-base) var(--ease-apple);
}

.card-hover:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.12);
}

/* ── OTP input highlight ── */
.otp-digit {
  transition:
    border-color var(--duration-fast) var(--ease-apple),
    box-shadow var(--duration-fast) var(--ease-apple),
    transform var(--duration-fast) var(--ease-bounce);
}

.otp-digit:focus {
  transform: scale(1.05);
  border-color: #0071e3;
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.2);
  outline: none;
}

.otp-digit.filled {
  border-color: #0071e3;
  background: #f0f7ff;
}
