/* ============ SCREEN TRANSITIONS ============ */

.screen-layer {
  position: absolute;
  inset: 0;
  background: var(--color-bg-page);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  will-change: transform, opacity;
}

.screen-layer--static { position: relative; }

/* Forward navigation — new screen slides in from right */
.screen-enter-forward {
  animation: slideInRight var(--duration-medium) var(--ease-standard) forwards;
}
.screen-exit-forward {
  animation: slideOutLeft var(--duration-medium) var(--ease-standard) forwards;
}

/* Back navigation — reverse */
.screen-enter-back {
  animation: slideInLeft var(--duration-medium) var(--ease-standard) forwards;
}
.screen-exit-back {
  animation: slideOutRight var(--duration-medium) var(--ease-standard) forwards;
}

/* Confirmation screens — fade + scale */
.screen-enter-confirm {
  animation: fadeScaleIn var(--duration-slow) var(--ease-standard) forwards;
}
.screen-exit-confirm {
  animation: fadeScaleOut var(--duration-medium) var(--ease-standard) forwards;
}

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0.8; }
  to   { transform: translateX(0);    opacity: 1; }
}

@keyframes slideOutLeft {
  from { transform: translateX(0);      opacity: 1; }
  to   { transform: translateX(-32%);   opacity: 0.6; }
}

@keyframes slideInLeft {
  from { transform: translateX(-32%); opacity: 0.6; }
  to   { transform: translateX(0);    opacity: 1; }
}

@keyframes slideOutRight {
  from { transform: translateX(0);     opacity: 1; }
  to   { transform: translateX(100%);  opacity: 0.8; }
}

@keyframes fadeScaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1);    }
}

@keyframes fadeScaleOut {
  from { opacity: 1; transform: scale(1);    }
  to   { opacity: 0; transform: scale(0.95); }
}

/* ============ CONFIRMATION ICON PULSE ============ */
@keyframes confirmPulse {
  0%   { transform: scale(0);   opacity: 0;   }
  60%  { transform: scale(1.2); opacity: 1;   }
  100% { transform: scale(1);   opacity: 1;   }
}

.confirmation__icon {
  animation: confirmPulse 400ms var(--ease-standard) forwards;
}

/* ============ MODAL ENTER ============ */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(8px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1);      }
}

/* ============ STAGGER (Votação list) ============ */
.stagger-item {
  opacity: 0;
  animation: staggerFadeIn 320ms var(--ease-standard) forwards;
}

.stagger-item:nth-child(1) { animation-delay:   0ms; }
.stagger-item:nth-child(2) { animation-delay:  80ms; }
.stagger-item:nth-child(3) { animation-delay: 160ms; }
.stagger-item:nth-child(4) { animation-delay: 240ms; }
.stagger-item:nth-child(5) { animation-delay: 320ms; }

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

/* ============ COUNTER TICK ============ */
@keyframes counterTick {
  0%   { transform: scale(1);    }
  50%  { transform: scale(1.15); }
  100% { transform: scale(1);    }
}

.counter-tick {
  display: inline-block;
  animation: counterTick 200ms var(--ease-standard);
}

/* Respect motion preferences */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
