/* ============================================= */
/* HEROUX23 – Micro-Interactions Ultra-Premium  */
/* Zero-Latency, 40ms scale, 220ms luminescent ripple */
/* ============================================= */

.es-ripple-host {
  position: relative !important;
  overflow: hidden !important;
  touch-action: manipulation;
}

/* Micro-Scale feedback ultra-rapido (40ms) */
.btn,
.btn-primary,
.btn-secondary,
.btn-nav-accedi,
.nav-brand,
.nav-item,
.es-touchable,
.hero-buttons-row .btn {
  transition: transform 40ms cubic-bezier(0.4, 0, 0.2, 1), box-shadow 120ms ease, opacity 120ms ease !important;
  will-change: transform;
}

.btn:active,
.btn-primary:active,
.btn-secondary:active,
.btn-nav-accedi:active,
.nav-brand:active,
.nav-item:active,
.es-touchable:active,
.hero-buttons-row .btn:active {
  transform: scale(0.98) !important;
}

/* Ripple luminescente al neon ciano Elisee */
.es-ripple {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.4) 0%, rgba(56, 189, 248, 0.12) 55%, transparent 100%);
  transform: translate3d(-50%, -50%, 0) scale(0);
  opacity: 1;
  animation: esRippleAnim 220ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
  will-change: transform, opacity;
  z-index: 99;
}

@keyframes esRippleAnim {
  0% {
    transform: translate3d(-50%, -50%, 0) scale(0);
    opacity: 0.9;
  }
  100% {
    transform: translate3d(-50%, -50%, 0) scale(2.6);
    opacity: 0;
  }
}

/* ============================================= */
/* UI-05 – Logout Fluid Transition & Toast       */
/* Zero layout shift, 300ms glide, a11y reduced   */
/* ============================================= */

.es-logout-fade-out {
  animation: esLogoutFade 300ms cubic-bezier(0.4, 0, 0.2, 1) forwards !important;
  pointer-events: none !important;
}

@keyframes esLogoutFade {
  0% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
  100% {
    opacity: 0;
    transform: translateY(-6px) scale(0.95);
    filter: blur(2px);
  }
}

/* Toast di chiusura sessione ultra-premium (senza stili inline) */
.es-logout-toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 999999;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  max-width: 340px;
  padding: 0.9rem 1.3rem;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.96), rgba(10, 15, 25, 0.98));
  border: 1px solid rgba(56, 189, 248, 0.35);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55), 0 0 20px rgba(56, 189, 248, 0.12);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  color: #e2e8f0;
  font-family: Inter, system-ui, -apple-system, sans-serif;
  animation: esToastSlideIn 320ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
  will-change: transform, opacity;
  pointer-events: auto;
}

.es-logout-toast.is-hiding {
  animation: esToastSlideOut 260ms cubic-bezier(0.4, 0, 1, 1) forwards;
}

.es-logout-toast-icon {
  font-size: 1.5rem;
  line-height: 1;
  flex-shrink: 0;
}

.es-logout-toast-body {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.es-logout-toast-title {
  color: #f1f5f9;
  font-weight: 700;
  font-size: 0.88rem;
  margin: 0;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.es-logout-toast-sub {
  color: #94a3b8;
  font-size: 0.78rem;
  margin: 0;
  line-height: 1.35;
}

.es-logout-toast-close {
  background: transparent;
  border: none;
  color: #64748b;
  font-size: 1.15rem;
  cursor: pointer;
  padding: 0 0 0 0.5rem;
  margin-left: auto;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 150ms ease;
}

.es-logout-toast-close:hover {
  color: #cbd5e1;
}

/* Light mode adaptivity */
html[data-theme="mimetico-chiaro"] .es-logout-toast {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(241, 245, 249, 0.98));
  border: 1px solid rgba(14, 165, 233, 0.4);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.15), 0 0 20px rgba(14, 165, 233, 0.15);
  color: #0f172a;
}

html[data-theme="mimetico-chiaro"] .es-logout-toast-title {
  color: #0f172a;
}

html[data-theme="mimetico-chiaro"] .es-logout-toast-sub {
  color: #475569;
}

html[data-theme="mimetico-chiaro"] .es-logout-toast-close {
  color: #94a3b8;
}

html[data-theme="mimetico-chiaro"] .es-logout-toast-close:hover {
  color: #334155;
}

@keyframes esToastSlideIn {
  0% {
    opacity: 0;
    transform: translate3d(0, 16px, 0) scale(0.96);
  }
  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

@keyframes esToastSlideOut {
  0% {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate3d(0, 12px, 0) scale(0.96);
  }
}

@media (max-width: 600px) {
  .es-logout-toast {
    right: 1rem;
    left: 1rem;
    bottom: 1.25rem;
    max-width: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .es-logout-fade-out,
  .es-logout-toast,
  .es-logout-toast.is-hiding {
    animation-duration: 1ms !important;
    transform: none !important;
  }
}
