/* ==========================================================================
   SueldoNeto - Animaciones y Microinteracciones
   Profesionales, sutiles, elegantes y compatibles con prefers-reduced-motion
   ========================================================================== */

/* 1. Animación del Panel y Valor del Resultado */
@keyframes resultPulse {
  0% {
    transform: translateY(0) scale(1);
    box-shadow: 0 12px 30px rgba(4, 47, 46, 0.3);
  }
  35% {
    transform: translateY(-3px) scale(1.008);
    box-shadow: 0 16px 36px rgba(13, 148, 136, 0.35);
  }
  70% {
    transform: translateY(1px) scale(1.002);
    box-shadow: 0 12px 28px rgba(13, 148, 136, 0.2);
  }
  100% {
    transform: translateY(0) scale(1);
    box-shadow: 0 12px 30px rgba(4, 47, 46, 0.3);
  }
}

@keyframes resultValueReveal {
  0% {
    opacity: 0.35;
    transform: translateY(8px) scale(0.96);
  }
  60% {
    opacity: 1;
    transform: translateY(-2px) scale(1.02);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

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

/* Clases activadas dinámicamente desde ui.js */
.result-panel.result-animate {
  animation: resultPulse 0.55s cubic-bezier(0.16, 1, 0.3, 1);
}

.result-panel.result-animate .result-main-value {
  animation: resultValueReveal 0.48s cubic-bezier(0.16, 1, 0.3, 1);
}

.result-panel.result-animate .breakdown-row {
  animation: fadeInSubtle 0.35s ease-out;
}

/* 2. Microinteracciones en Formularios */
.salary-input, .styled-select {
  transition: border-color 0.2s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.2s cubic-bezier(0.16, 1, 0.3, 1),
              background-color 0.2s ease;
}

.chip-btn:active {
  transform: scale(0.96);
}

.calc-submit-btn {
  position: relative;
  overflow: hidden;
}

.calc-submit-btn::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 120%;
  height: 120%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 10%, transparent 60%);
  transform: translate(-50%, -50%) scale(0);
  opacity: 0;
  transition: transform 0.4s ease, opacity 0.3s ease;
  pointer-events: none;
}

.calc-submit-btn:active::after {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
  transition: 0s;
}

/* 3. Transiciones de Pestañas */
.calc-tab {
  transition: background-color 0.2s ease,
              color 0.2s ease,
              box-shadow 0.2s ease,
              transform 0.15s ease;
}

.calc-tab:active {
  transform: scale(0.98);
}

/* 4. Barras de Desglose */
.dist-bar-seg {
  transition: width 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

/* 5. Transición del Menú Móvil */
.site-nav {
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1),
              opacity 0.2s ease,
              visibility 0.25s ease;
}

/* 6. Animaciones Sutiles de la Portada */
@keyframes titleIconFloat {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-4px) rotate(2deg);
  }
}

@keyframes titleIconGlow {
  0%, 100% {
    box-shadow: 0 4px 14px rgba(13, 148, 136, 0.25);
  }
  50% {
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.45);
  }
}

@keyframes ambientOrb {
  0%, 100% {
    transform: translate(0, 0) scale(1);
    opacity: 0.6;
  }
  50% {
    transform: translate(25px, -15px) scale(1.08);
    opacity: 0.85;
  }
}

@keyframes borderSheen {
  0% {
    border-color: var(--border-color);
  }
  50% {
    border-color: rgba(13, 148, 136, 0.35);
  }
  100% {
    border-color: var(--border-color);
  }
}

.hero-title-icon-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  background: linear-gradient(135deg, #042f2e 0%, #0f766e 100%);
  border: 2px solid rgba(52, 211, 153, 0.45);
  color: #34d399 !important;
  border-radius: 13px;
  margin-left: 10px;
  vertical-align: middle;
  box-shadow: 0 4px 16px rgba(4, 47, 46, 0.3);
  animation: titleIconFloat 4s ease-in-out infinite, titleIconGlow 3s ease-in-out infinite;
}

.hero-title-icon-badge svg {
  stroke: #ffffff !important;
  color: #ffffff !important;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.hero-ambient-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  pointer-events: none;
  z-index: -1;
  animation: ambientOrb 9s ease-in-out infinite;
}

.calculator-wrapper {
  animation: borderSheen 6s ease-in-out infinite;
}

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

  .result-panel.result-animate,
  .result-panel.result-animate .result-main-value,
  .result-panel.result-animate .breakdown-row {
    animation: none !important;
  }

  .calc-tab,
  .calc-submit-btn,
  .feature-card,
  .article-card {
    transition: none !important;
    transform: none !important;
  }
}
