/**
 * ExcelBills V2 — Auth motion layer (signup / signin polish)
 * GPU-friendly: transform + opacity only. Respects prefers-reduced-motion.
 */
:root {
  --eb-v2-auth-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ── Floating background orbs ── */
.eb-v2-auth-orbs {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.eb-v2-auth-orbs__orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(72px);
  opacity: 0.07;
  will-change: transform;
}

.eb-v2-auth-orbs__orb--blue {
  width: 420px;
  height: 420px;
  top: 8%;
  left: -8%;
  background: radial-gradient(circle, #3b82f6 0%, transparent 68%);
  animation: eb-v2-auth-orb-drift-a 18s var(--eb-v2-auth-ease) infinite alternate;
}

.eb-v2-auth-orbs__orb--green {
  width: 380px;
  height: 380px;
  bottom: 6%;
  right: -6%;
  background: radial-gradient(circle, #10b981 0%, transparent 68%);
  animation: eb-v2-auth-orb-drift-b 16s var(--eb-v2-auth-ease) infinite alternate;
}

@keyframes eb-v2-auth-orb-drift-a {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(48px, 36px, 0); }
}

@keyframes eb-v2-auth-orb-drift-b {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-40px, -28px, 0); }
}

.eb-v2-auth .lp-auth-viz > :not(.eb-v2-auth-orbs) {
  position: relative;
  z-index: 1;
}

/* ── Page enter sequence ── */
.eb-v2-auth-enter,
.eb-v2-auth-panel-enter {
  opacity: 0;
  transform: translate3d(0, 20px, 0);
  transition:
    opacity 700ms var(--eb-v2-auth-ease),
    transform 700ms var(--eb-v2-auth-ease);
}

.eb-v2-auth-enter[data-eb-auth-enter="metric"],
.eb-v2-auth-trust > span {
  transform: translate3d(0, 15px, 0);
}

.eb-v2-auth-enter[data-eb-auth-enter="subhead"] {
  transition-duration: 600ms;
}

.eb-v2-auth-panel-enter {
  transform: translate3d(0, 25px, 0);
  transition: transform 700ms var(--eb-v2-auth-ease);
}

.eb-v2-auth-motion-active .eb-v2-auth-enter,
.eb-v2-auth-motion-active .eb-v2-auth-panel-enter {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.eb-v2-auth-motion-active .eb-v2-auth-enter[data-eb-auth-enter="logo"] { transition-delay: 0ms; }
.eb-v2-auth-motion-active .eb-v2-auth-enter[data-eb-auth-enter="badge"] { transition-delay: 50ms; }
.eb-v2-auth-motion-active .eb-v2-auth-enter[data-eb-auth-enter="headline"] { transition-delay: 100ms; }
.eb-v2-auth-motion-active .eb-v2-auth-enter[data-eb-auth-enter="subhead"] { transition-delay: 250ms; }
.eb-v2-auth-motion-active .eb-v2-auth-enter[data-eb-auth-enter="metric"][data-eb-auth-metric="0"] { transition-delay: 350ms; }
.eb-v2-auth-motion-active .eb-v2-auth-enter[data-eb-auth-enter="metric"][data-eb-auth-metric="1"] { transition-delay: 430ms; }
.eb-v2-auth-motion-active .eb-v2-auth-enter[data-eb-auth-enter="metric"][data-eb-auth-metric="2"] { transition-delay: 510ms; }
.eb-v2-auth-motion-active .eb-v2-auth-enter[data-eb-auth-enter="metric"][data-eb-auth-metric="3"] { transition-delay: 590ms; }
.eb-v2-auth-motion-active .eb-v2-auth-enter[data-eb-auth-enter="ai"] { transition-delay: 670ms; }
.eb-v2-auth-motion-active .eb-v2-auth-panel-enter { transition-delay: 300ms; transition-duration: 700ms; }
.eb-v2-auth-motion-active.eb-v2-auth--signup .eb-v2-auth-enter[data-eb-auth-enter="steps"] { transition-delay: 320ms; }
.eb-v2-auth-motion-active.eb-v2-auth--signup .eb-v2-auth-enter[data-eb-auth-enter="panel-title"] { transition-delay: 380ms; }
.eb-v2-auth-motion-active.eb-v2-auth--signup .eb-v2-auth-enter[data-eb-auth-enter="panel-sub"] { transition-delay: 430ms; }
.eb-v2-auth-motion-active.eb-v2-auth--signup .eb-v2-auth-form .lp-auth-field--float:nth-child(1) { transition-delay: 480ms; }
.eb-v2-auth-motion-active.eb-v2-auth--signup .eb-v2-auth-form .lp-auth-field--float:nth-child(2) { transition-delay: 520ms; }
.eb-v2-auth-motion-active.eb-v2-auth--signup .eb-v2-auth-form .lp-auth-field--float:nth-child(3) { transition-delay: 560ms; }
.eb-v2-auth-motion-active.eb-v2-auth--signup .eb-v2-auth-form .lp-auth-field--float:nth-child(4) { transition-delay: 600ms; }
.eb-v2-auth-motion-active .eb-v2-auth-enter[data-eb-auth-enter="cta"] { transition-delay: 650ms; transition-duration: 500ms; }
.eb-v2-auth-motion-active .eb-v2-auth-enter[data-eb-auth-enter="divider"] { transition-delay: 680ms; transition-duration: 400ms; }
.eb-v2-auth-motion-active .eb-v2-auth-enter[data-eb-auth-enter="footer-link"] { transition-delay: 720ms; transition-duration: 400ms; }
.eb-v2-auth-motion-active .eb-v2-auth-enter[data-eb-auth-enter="home-card"] { transition-delay: 760ms; transition-duration: 500ms; }

/* ── Metric cards hover ── */
.eb-v2-auth-viz__card {
  transition:
    transform 200ms var(--eb-v2-auth-ease),
    box-shadow 200ms var(--eb-v2-auth-ease);
}

.eb-v2-auth-viz__card:hover {
  transform: translate3d(0, -4px, 0);
  box-shadow: 0 12px 32px rgba(17, 24, 39, 0.1);
}

/* ── AI recommendation card glow ── */
.eb-v2-auth-viz__card--ai {
  position: relative;
  overflow: hidden;
}

.eb-v2-auth-viz__card--ai::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.35), rgba(16, 185, 129, 0.35));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0.06;
  pointer-events: none;
  animation: eb-v2-auth-ai-glow 8s var(--eb-v2-auth-ease) infinite;
}

@keyframes eb-v2-auth-ai-glow {
  0%, 100% { opacity: 0.05; }
  50% { opacity: 0.1; }
}

.eb-v2-auth-viz__ai-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.eb-v2-auth-ai-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--eb-v2-revenue);
}

.eb-v2-auth-ai-status__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--eb-v2-revenue);
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.45);
  animation: eb-v2-auth-ai-pulse 2.4s var(--eb-v2-auth-ease) infinite;
}

@keyframes eb-v2-auth-ai-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.35); opacity: 1; }
  50% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); opacity: 0.75; }
}

/* ── Floating labels (signup) ── */
.eb-v2-auth--signup .lp-auth-field--float {
  position: relative;
  margin-bottom: 1.15rem;
}

.eb-v2-auth--signup .lp-auth-field--float label {
  position: absolute;
  left: 16px;
  top: 50%;
  margin: 0;
  transform: translate3d(0, -50%, 0);
  transform-origin: left top;
  pointer-events: none;
  color: var(--eb-v2-text-muted);
  font-size: 15px;
  font-weight: 500;
  transition:
    transform 150ms var(--eb-v2-auth-ease),
    color 150ms var(--eb-v2-auth-ease),
    top 150ms var(--eb-v2-auth-ease);
  z-index: 1;
}

.eb-v2-auth--signup .lp-auth-field--float input {
  padding: 20px 16px 10px;
  transition:
    border-color 150ms var(--eb-v2-auth-ease),
    box-shadow 150ms var(--eb-v2-auth-ease),
    transform 150ms var(--eb-v2-auth-ease);
}

.eb-v2-auth--signup .lp-auth-field--float input::placeholder {
  color: transparent;
}

.eb-v2-auth--signup .lp-auth-field--float:focus-within label,
.eb-v2-auth--signup .lp-auth-field--float.has-value label {
  top: 10px;
  transform: translate3d(0, 0, 0) scale(0.82);
  color: var(--eb-v2-text-muted);
  font-weight: 600;
}

.eb-v2-auth--signup .lp-auth-field--float:focus-within input {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12), 0 4px 12px rgba(17, 24, 39, 0.06);
  transform: translate3d(0, -1px, 0);
}

/* ── CTA buttons ── */
.eb-v2-auth-cta {
  position: relative;
  overflow: hidden;
  transition:
    transform 200ms var(--eb-v2-auth-ease),
    box-shadow 200ms var(--eb-v2-auth-ease);
}

.eb-v2-auth-cta.is-active {
  background-size: 200% 100%;
  background-image: linear-gradient(135deg, #111827 0%, #374151 45%, #1f2937 55%, #111827 100%);
}

.eb-v2-auth-cta.is-active::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 38%, rgba(255, 255, 255, 0.14) 50%, transparent 62%);
  transform: translate3d(-120%, 0, 0);
  animation: eb-v2-auth-shimmer 10s var(--eb-v2-auth-ease) infinite;
  pointer-events: none;
}

@keyframes eb-v2-auth-shimmer {
  0%, 72% { transform: translate3d(-120%, 0, 0); opacity: 0; }
  78% { opacity: 1; }
  88%, 100% { transform: translate3d(120%, 0, 0); opacity: 0; }
}

.eb-v2-auth-cta:hover,
.eb-v2-auth-google:hover {
  transform: translate3d(0, -2px, 0);
}

.eb-v2-auth-cta:hover {
  box-shadow: 0 12px 28px rgba(17, 24, 39, 0.28);
}

.eb-v2-auth-google {
  transition:
    transform 200ms var(--eb-v2-auth-ease),
    box-shadow 200ms var(--eb-v2-auth-ease),
    border-color 200ms var(--eb-v2-auth-ease);
}

.eb-v2-auth-google:hover {
  border-color: rgba(37, 99, 235, 0.35);
  box-shadow: 0 8px 20px rgba(17, 24, 39, 0.08);
}

/* ── Homepage back card ── */
.eb-v2-auth-enter[data-eb-auth-enter="home-card"] {
  transition-duration: 200ms;
}

.eb-v2-auth-motion-active .lp-auth-back:hover {
  transform: translate3d(0, -3px, 0);
}

.eb-v2-auth-motion-active .lp-auth-back:hover .lp-auth-back__chevron {
  transform: translate3d(4px, 0, 0);
}

/* ── Trust badges stagger ── */
.eb-v2-auth-trust {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
}

.eb-v2-auth-trust > span {
  opacity: 0;
  transform: translate3d(0, 12px, 0);
  transition:
    opacity 500ms var(--eb-v2-auth-ease),
    transform 500ms var(--eb-v2-auth-ease);
}

.eb-v2-auth-trust.is-visible > span:nth-child(1) { opacity: 1; transform: none; transition-delay: 0ms; }
.eb-v2-auth-trust.is-visible > span:nth-child(2) { opacity: 1; transform: none; transition-delay: 80ms; }
.eb-v2-auth-trust.is-visible > span:nth-child(3) { opacity: 1; transform: none; transition-delay: 160ms; }
.eb-v2-auth-trust.is-visible > span:nth-child(4) { opacity: 1; transform: none; transition-delay: 240ms; }

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  .eb-v2-auth-enter,
  .eb-v2-auth-panel-enter,
  .eb-v2-auth-trust > span {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  .eb-v2-auth-orbs__orb,
  .eb-v2-auth-viz__card--ai::before,
  .eb-v2-auth-ai-status__dot,
  .eb-v2-auth-cta.is-active::after {
    animation: none !important;
  }

  .eb-v2-auth-viz__card:hover,
  .eb-v2-auth-cta:hover,
  .eb-v2-auth-google:hover,
  .lp-auth-back:hover {
    transform: none !important;
  }
}
