/* ============================================ */
/* ======= ACCESSIBILITY: FOCUS INDICATORS ==== */
/* ============================================ */

/* Visible focus ring for keyboard navigation */
/* Uses :focus-visible to only show on keyboard, not mouse clicks */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid #a855f7;
  outline-offset: 3px;
  border-radius: 4px;
}

/* Navigation links focus state */
nav a:focus-visible {
  outline: 2px solid #a855f7;
  outline-offset: 4px;
  border-radius: 4px;
  background-color: rgba(168, 85, 247, 0.1);
}

/* CTA buttons focus state */
.cta-button:focus-visible,
button[type="submit"]:focus-visible {
  outline: 3px solid #a855f7;
  outline-offset: 4px;
  box-shadow: 0 0 0 6px rgba(168, 85, 247, 0.2);
}

/* Remove default browser focus styles */
a:focus:not(:focus-visible),
button:focus:not(:focus-visible),
input:focus:not(:focus-visible),
textarea:focus:not(:focus-visible) {
  outline: none;
}

/* ============================================ */
/* ========= FONDOS Y EFECTOS GLOBALES ======== */
/* ============================================ */
/* Fondo con mesh gradient sutil */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(
      circle at 20% 30%,
      rgba(124, 58, 237, 0.08) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 80% 70%,
      rgba(59, 130, 246, 0.08) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 50% 50%,
      rgba(236, 72, 153, 0.05) 0%,
      transparent 50%
    );
  pointer-events: none;
  z-index: 0;
}
/* Noise texture para profundidad */
body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.03'/%3E%3C/svg%3E");
  opacity: 0.4;
  pointer-events: none;
  z-index: 0;
}
/* Asegurar que el contenido esté por encima */
header,
main,
footer {
  position: relative;
  z-index: 1;
}
/* ============================================ */
/* ========= HERO GLOW EFFECT MEJORADO ======== */
/* ============================================ */
/* Efecto de gradiente mesh animado para el hero */
.glow-bg::before {
  content: '';
  position: absolute;
  top: -20%;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  height: 100%;
  background-image: radial-gradient(
      circle at 30% 20%,
      rgba(168, 85, 247, 0.25),
      transparent 40%
    ),
    radial-gradient(
      circle at 70% 60%,
      rgba(59, 130, 246, 0.2),
      transparent 40%
    ),
    radial-gradient(
      circle at 50% 80%,
      rgba(236, 72, 153, 0.15),
      transparent 40%
    );
  filter: blur(120px);
  z-index: -1;
  animation: mesh-float 20s ease-in-out infinite;
}
/* ============================================ */
/* ========= SECTION GLOWS ==================== */
/* ============================================ */
.section-glow {
  position: relative;
}
.section-glow::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  width: 300px;
  height: 300px;
  background: radial-gradient(
    circle,
    rgba(124, 58, 237, 0.15),
    transparent 70%
  );
  filter: blur(80px);
  z-index: -1;
  pointer-events: none;
}
.section-glow::after {
  content: '';
  position: absolute;
  top: 50%;
  right: 0;
  width: 300px;
  height: 300px;
  background: radial-gradient(
    circle,
    rgba(59, 130, 246, 0.12),
    transparent 70%
  );
  filter: blur(80px);
  z-index: -1;
  pointer-events: none;
}
/* FAQ Accordion with smooth animations */
/* Remove overflow-hidden from FAQ articles when expanded to show full border effect */
#faq article.group {
  overflow: visible;
}
.faq-answer {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.faq-answer.faq-expanded {
  max-height: 1000px;
  opacity: 1;
  transition: max-height 0.6s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1) 0.1s;
}
.faq-icon {
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.faq-question {
  cursor: pointer;
}
/* Border animation for expanded FAQ - applies to entire article container */
/* This ensures the border wraps around the question AND the expanded answer */
/* Using higher specificity with .group class to avoid !important */
#faq article.group.faq-article-expanded {
  border-width: 2px;
  border-color: rgb(168 85 247 / 0.8);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5),
    0 0 80px rgba(168, 85, 247, 0.3),
    inset 0 0 40px rgba(168, 85, 247, 0.1);
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
/* Disable hover effects when FAQ is expanded */
#faq article.group.faq-article-expanded:hover {
  transform: none;
  border-color: rgb(168 85 247 / 0.8);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5),
    0 0 80px rgba(168, 85, 247, 0.3),
    inset 0 0 40px rgba(168, 85, 247, 0.1);
}
/* Remove focus ring from button when FAQ is expanded to avoid double borders */
#faq article.group.faq-article-expanded .faq-question:focus {
  outline: none;
  box-shadow: none;
}
/* Also remove focus ring on active/focus states */
#faq .faq-question:focus,
#faq .faq-question:active {
  outline: none;
}

/* ============================================ */
/* ========= ANIMATION KEYFRAMES ============== */
/* ============================================ */

@keyframes float-sm {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-8px); }
    100% { transform: translateY(0px); }
}

@keyframes float-rotate {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-15px) rotate(5deg);
  }
}

@keyframes mesh-float {
  0%, 100% {
    transform: translateX(-50%) translateY(0) scale(1);
    opacity: 1;
  }
  50% {
    transform: translateX(-50%) translateY(-30px) scale(1.05);
    opacity: 0.8;
  }
}

@keyframes gradient-shift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes gradient-rotate {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.2);
  }
  50% {
    box-shadow: 0 0 40px rgba(168, 85, 247, 0.4);
  }
}

@keyframes shimmer {
  0% { background-position: -1000px 0; }
  100% { background-position: 1000px 0; }
}

/* ============================================ */
/* ========= SCROLL REVEAL SETUP ============== */
/* ============================================ */
[data-reveal] {
  opacity: 0;
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-reveal="fade-up"] {
  transform: translateY(40px);
}

[data-reveal="fade-left"] {
  transform: translateX(-40px);
}

[data-reveal="fade-right"] {
  transform: translateX(40px);
}

[data-reveal].is-visible {
  opacity: 1;
  transform: none;
  transition-delay: var(--reveal-delay, 0s);
}


/* ============================================ */
/* ========= COMPONENT ANIMATIONS ============= */
/* ============================================ */

/* --- Cards --- */
.card-hover-effect {
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.5s ease,
              border-color 0.5s ease,
              background-color 0.5s ease;
}

.card-hover-effect:hover {
  transform: translateY(-12px);
}

/* --- Buttons --- */
.btn-animated {
  display: inline-block;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.3s ease,
              background-color 0.3s ease;
  will-change: transform;
}

.btn-animated:hover {
  transform: scale(1.05) translateY(-2px);
}

.btn-animated:active {
  transform: scale(1.02);
}

/* Gradient animated buttons */
.btn-gradient-animated {
  background-size: 200% 200%;
  animation: gradient-shift 3s ease infinite;
}

/* Magnetic effect for buttons */
.btn-magnetic {
  transition: transform 0.2s ease-out;
}

/* --- Floating Image --- */
.img-float {
    animation: float-sm 4s ease-in-out infinite;
}

/* --- Icon Float with Rotation --- */
.icon-float {
  animation: float-rotate 6s ease-in-out infinite;
}

/* --- Shimmer Effect --- */
.shimmer {
  position: relative;
  overflow: hidden;
}

.shimmer::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.05),
    transparent
  );
  background-size: 1000px 100%;
  animation: shimmer 3s infinite;
}

/* --- Glow Pulse Effect --- */
.card-glow:hover {
  animation: pulse-glow 2s ease-in-out infinite;
}

/* ============================================ */
/* ========= TEXT ROTATOR ANIMATION =========== */
/* ============================================ */

#rotating-text {
    position: relative;
    display: inline-block;
    vertical-align: baseline;
    text-align: left;
    white-space: nowrap; /* Fix: Prevent text wrapping on mobile */

    /* Hereda el gradiente */
    background: inherit;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* El cursor se gestiona con una clase desde JS */
#rotating-text.cursor::after {
    content: '';
    position: absolute;
    right: -3px;
    top: 10%;
    height: 80%;
    width: 3px;
    background: #60a5fa;
    animation: blink 0.7s infinite;
}

@keyframes blink {
    50% { opacity: 0; }
}

/* ============================================ */
/* ========= GRADIENT ANIMATIONS ============== */
/* ============================================ */

.animate-gradient {
  background-size: 200% 200%;
  animation: gradient-rotate 5s ease infinite;
}

/* ============================================ */
/* ========= PERSPECTIVE & 3D EFFECTS ========= */
/* ============================================ */

.perspective-1000 {
  perspective: 1000px;
}

/* ============================================ */
/* ========= LINK UNDERLINE ANIMATION ========= */
/* ============================================ */

.link-underline {
  position: relative;
}

.link-underline::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #a855f7, #06b6d4);
  transition: width 0.3s ease;
}

.link-underline:hover::after {
  width: 100%;
}

/* ============================================ */
/* ====== WHATSAPP FLOATING BUTTON ============ */
/* ============================================ */

/* Animación de flotación suave */
@keyframes whatsapp-float {
  0%, 100% {
    transform: translateY(0px) scale(1);
  }
  50% {
    transform: translateY(-10px) scale(1.02);
  }
}

/* Animación de pulse para el badge */
@keyframes whatsapp-pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.8;
  }
}

/* Animación de ripple en el icono */
@keyframes whatsapp-ripple {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  100% {
    transform: scale(1.5);
    opacity: 0;
  }
}

/* Animación del tooltip */
@keyframes tooltip-slide-in {
  from {
    opacity: 0;
    transform: translateX(10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Contenedor del botón flotante */
.whatsapp-float {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 9999;
  animation: whatsapp-float 3s ease-in-out infinite;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.whatsapp-float:hover {
  animation-play-state: paused;
  transform: scale(1.1) translateY(-5px);
}

/* El botón principal */
.whatsapp-button {
  position: relative;
  width: 65px;
  height: 65px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;

  /* Glassmorphism effect */
  background: linear-gradient(135deg,
    rgba(37, 211, 102, 0.9) 0%,
    rgba(34, 193, 195, 0.9) 100%);
  backdrop-filter: blur(10px);

  /* Multiple layered shadows for depth */
  box-shadow:
    0 8px 32px rgba(37, 211, 102, 0.4),
    0 4px 16px rgba(0, 0, 0, 0.3),
    inset 0 1px 1px rgba(255, 255, 255, 0.3);

  border: 2px solid rgba(255, 255, 255, 0.2);
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.whatsapp-button::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: linear-gradient(135deg, #25d366, #22c1c3);
  opacity: 0;
  z-index: -1;
  transition: opacity 0.4s ease;
  animation: whatsapp-ripple 2s infinite;
}

.whatsapp-button:hover {
  transform: rotate(360deg) scale(1.05);
  box-shadow:
    0 12px 48px rgba(37, 211, 102, 0.6),
    0 8px 24px rgba(0, 0, 0, 0.4),
    inset 0 1px 1px rgba(255, 255, 255, 0.4);
  border-color: rgba(255, 255, 255, 0.4);
}

.whatsapp-button:hover::before {
  opacity: 0.3;
}

.whatsapp-button:active {
  transform: scale(0.95);
}

/* WhatsApp icon */
.whatsapp-icon {
  width: 36px;
  height: 36px;
  color: white;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
  transition: transform 0.3s ease;
  position: relative;
  z-index: 1;
}

.whatsapp-button:hover .whatsapp-icon {
  transform: scale(1.15);
}

/* Badge "Online" */
.whatsapp-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  background: linear-gradient(135deg, #a855f7, #ec4899);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow:
    0 4px 12px rgba(168, 85, 247, 0.4),
    0 2px 6px rgba(0, 0, 0, 0.3);
  border: 2px solid rgba(255, 255, 255, 0.3);
  animation: whatsapp-pulse 2s ease-in-out infinite;
  white-space: nowrap;
}

/* Pulse ring effect */
.whatsapp-badge::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 12px;
  background: linear-gradient(135deg, #a855f7, #ec4899);
  opacity: 0.5;
  z-index: -1;
  animation: whatsapp-ripple 2s infinite;
}

/* Tooltip */
.whatsapp-tooltip {
  position: absolute;
  right: 80px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(12px);
  color: white;
  padding: 12px 20px;
  border-radius: 12px;
  white-space: nowrap;
  font-size: 15px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;

  /* Glassmorphism border */
  border: 1px solid rgba(255, 255, 255, 0.1);

  /* Premium shadow */
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.05);

  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Tooltip arrow */
.whatsapp-tooltip::after {
  content: '';
  position: absolute;
  right: -6px;
  top: 50%;
  transform: translateY(-50%) rotate(45deg);
  width: 12px;
  height: 12px;
  background: rgba(15, 23, 42, 0.95);
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Show tooltip on hover */
.whatsapp-float:hover .whatsapp-tooltip {
  opacity: 1;
  animation: tooltip-slide-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Gradient text effect for tooltip */
.whatsapp-tooltip span {
  background: linear-gradient(135deg, #a855f7, #06b6d4, #ec4899);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradient-shift 3s ease infinite;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
  .whatsapp-float {
    bottom: 20px;
    right: 20px;
  }

  .whatsapp-button {
    width: 60px;
    height: 60px;
  }

  .whatsapp-icon {
    width: 32px;
    height: 32px;
  }

  .whatsapp-badge {
    top: -6px;
    right: -6px;
    font-size: 9px;
    padding: 3px 6px;
  }

  .whatsapp-tooltip {
    right: 75px;
    font-size: 13px;
    padding: 10px 16px;
  }
}

/* Extra small screens - respects iPhone home indicator safe area */
@media (max-width: 480px) {
  .whatsapp-float {
    bottom: 24px;
    right: 20px;
  }

  .whatsapp-button {
    width: 55px;
    height: 55px;
  }

  .whatsapp-icon {
    width: 28px;
    height: 28px;
  }
}

/* Accessibility: Respect prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  .whatsapp-float,
  .whatsapp-badge,
  .whatsapp-button::before,
  .whatsapp-badge::before {
    animation: none;
  }

  .whatsapp-button:hover {
    transform: scale(1.05);
  }
}

/* ============================================ */
/* ====== FORM VALIDATION ANIMATIONS ========== */
/* ============================================ */

/* Shake animation for errors */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-8px); }
  20%, 40%, 60%, 80% { transform: translateX(8px); }
}

/* Fade in animation for validation icons */
@keyframes fade-in {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Fade out animation */
@keyframes fade-out {
  from {
    opacity: 1;
    transform: scale(1);
  }
  to {
    opacity: 0;
    transform: scale(0.8);
  }
}

/* Success checkmark animation */
@keyframes checkmark-draw {
  0% {
    stroke-dashoffset: 100;
  }
  100% {
    stroke-dashoffset: 0;
  }
}

/* Pulse animation for success */
@keyframes pulse-success {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

/* Spinner gradient animation */
@keyframes spinner-gradient {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Toast slide in from right */
@keyframes toast-slide-in {
  from {
    transform: translateX(500px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Toast slide out to right */
@keyframes toast-slide-out {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(500px);
    opacity: 0;
  }
}

/* ============================================ */
/* ======= BROWSER AUTOFILL STYLING ========== */
/* ============================================ */

/**
 * Override browser autocomplete styling
 * Only applies when user accepts a browser suggestion
 */

/* Webkit browsers (Chrome, Safari, Edge) */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active,
textarea:-webkit-autofill,
textarea:-webkit-autofill:hover,
textarea:-webkit-autofill:focus,
textarea:-webkit-autofill:active {
  /* Background color using box-shadow inset trick */
  -webkit-box-shadow: 0 0 0 1000px #172134 inset !important;
  /* Text color when autofilled */
  -webkit-text-fill-color: #ffffff !important;
  /* Delay the yellow flash animation */
  transition: background-color 5000s ease-in-out 0s;
}

/* Firefox autofill */
input:-moz-autofill,
input:-moz-autofill-preview {
  background-color: #172134 !important;
  color: #ffffff !important;
}

/* ============================================ */
/* ====== FORM VALIDATION STATES ============== */
/* ============================================ */

/* Valid input state */
/* !important required to override Tailwind focus states applied inline */
.input-valid {
  border-color: #10b981 !important;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1) !important;
}

/* Invalid input state */
/* !important required to override Tailwind focus states applied inline */
.input-invalid {
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
  animation: shake 0.5s ease-in-out;
}

/* Validation icon styles */
.validation-icon {
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.validation-icon.show {
  opacity: 1;
  animation: fade-in 0.3s ease forwards;
}

.validation-icon.success {
  color: #10b981;
}

.validation-icon.error {
  color: #ef4444;
}

/* Success icon animation */
.validation-icon.success svg {
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  animation: checkmark-draw 0.5s ease forwards;
}

/* Error message styles */
.error-message {
  animation: fade-in 0.3s ease;
}

.error-message.show {
  display: block;
}

/* ============================================ */
/* ========= LOADING BUTTON STATES ============ */
/* ============================================ */

/* Button loading state */
#submit-btn.loading {
  pointer-events: none;
  opacity: 0.7;
}

#submit-btn.loading .submit-text {
  opacity: 0;
}

#submit-btn.loading .submit-arrow {
  opacity: 0;
}

#submit-btn.loading .loading-spinner {
  display: block;
  animation: spinner-gradient 1s linear infinite;
}

/* Loading spinner with gradient effect */
.loading-spinner svg circle {
  stroke: url(#gradient);
}

/* ============================================ */
/* ========= NOTIFICATION TOAST =============== */
/* ============================================ */

/* Toast container */
#notification-toast {
  pointer-events: none;
}

#notification-toast.show {
  pointer-events: all;
  transform: translateX(0);
  animation: toast-slide-in 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

#notification-toast.hide {
  animation: toast-slide-out 0.4s ease forwards;
}

/* Notification content glassmorphism */
.notification-content {
  position: relative;
  overflow: hidden;
}

.notification-content::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(168, 85, 247, 0.05) 0%,
    transparent 50%,
    rgba(6, 182, 212, 0.05) 100%
  );
  pointer-events: none;
}

/* Success state */
#notification-toast.success .notification-icon-container {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(5, 150, 105, 0.2));
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.3);
}

#notification-toast.success .success-icon {
  display: block;
  color: #10b981;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  animation: checkmark-draw 0.6s ease forwards, pulse-success 0.6s ease 0.3s;
}

/* Error state */
#notification-toast.error .notification-icon-container {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(220, 38, 38, 0.2));
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.3);
}

#notification-toast.error .error-icon {
  display: block;
  color: #ef4444;
  animation: pulse-success 0.6s ease;
}

/* Title and message fade in */
.notification-title,
.notification-message {
  animation: fade-in 0.6s ease 0.2s backwards;
}

/* ============================================ */
/* ========= FORM FIELD FOCUS EFFECTS ========= */
/* ============================================ */

/* Enhanced focus state with gradient border */
#contact-form input:focus,
#contact-form textarea:focus {
  position: relative;
}

/* Smooth transitions for all form elements */
#contact-form input,
#contact-form textarea {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Label color transitions */
#contact-form label {
  transition: color 0.3s ease;
}

/* ============================================ */
/* ========= DISABLED FORM STATE ============== */
/* ============================================ */

#contact-form.submitting input,
#contact-form.submitting textarea {
  opacity: 0.6;
  pointer-events: none;
  cursor: not-allowed;
}

#contact-form.submitting label {
  opacity: 0.6;
}

/* ============================================ */
/* ========= RESPONSIVE ADJUSTMENTS =========== */
/* ============================================ */

@media (max-width: 768px) {
  /* Adjust toast position on mobile - moved to top to avoid WhatsApp button conflict */
  #notification-toast {
    top: 20px;
    bottom: auto;
    right: 20px;
    left: 20px;
    transform: translateY(-200px);
  }

  /* Override with same specificity in media query context */
  #notification-toast.show {
    transform: translateY(0);
  }

  .notification-content {
    min-width: auto;
    max-width: 100%;
  }

  /* Toast animations for mobile */
  @keyframes toast-slide-in {
    from {
      transform: translateY(200px);
      opacity: 0;
    }
    to {
      transform: translateY(0);
      opacity: 1;
    }
  }

  @keyframes toast-slide-out {
    from {
      transform: translateY(0);
      opacity: 1;
    }
    to {
      transform: translateY(200px);
      opacity: 0;
    }
  }
}

/* ============================================ */
/* ========= ACCESSIBILITY ==================== */
/* ============================================ */

/* Respect prefers-reduced-motion for form animations */
@media (prefers-reduced-motion: reduce) {
  .input-invalid {
    animation: none;
  }

  .validation-icon,
  .error-message,
  .notification-title,
  .notification-message {
    animation: none;
    opacity: 1;
  }

  #notification-toast.show,
  #notification-toast.hide {
    animation: none;
    transition: opacity 0.3s ease;
  }

  .loading-spinner svg {
    animation-duration: 2s;
  }
}

/* ============================================ */
/* ========= MOBILE MENU ANIMATIONS =========== */
/* ============================================ */

/* Mobile menu slide-in animation */
@keyframes mobile-menu-slide {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Mobile menu when visible */
#menu-mobile:not(.hidden) {
  animation: mobile-menu-slide 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Hamburger button animations */
#menu-btn {
  position: relative;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Hamburger button hover effect - matches .btn-animated pattern */
#menu-btn:hover {
  transform: scale(1.05);
}

/* Hamburger button active state */
#menu-btn:active {
  transform: scale(0.95);
}

/* Hamburger icon rotation when menu is open */
#menu-btn[aria-expanded="true"] svg {
  transform: rotate(90deg);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

#menu-btn[aria-expanded="false"] svg {
  transform: rotate(0deg);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Add subtle glow effect when menu is open - matches site's glow aesthetic */
#menu-btn[aria-expanded="true"] {
  background: rgba(168, 85, 247, 0.1);
  border-radius: 8px;
  box-shadow: 0 0 20px rgba(168, 85, 247, 0.2);
  transition: all 0.3s ease;
}

/* Mobile menu links stagger animation */
#menu-mobile:not(.hidden) a {
  animation: mobile-menu-slide 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  opacity: 0;
}

#menu-mobile:not(.hidden) a:nth-child(1) {
  animation-delay: 0.05s;
}

#menu-mobile:not(.hidden) a:nth-child(2) {
  animation-delay: 0.1s;
}

#menu-mobile:not(.hidden) a:nth-child(3) {
  animation-delay: 0.15s;
}

#menu-mobile:not(.hidden) a:nth-child(4) {
  animation-delay: 0.2s;
}

#menu-mobile:not(.hidden) a:nth-child(5) {
  animation-delay: 0.25s;
}

#menu-mobile:not(.hidden) a:nth-child(6) {
  animation-delay: 0.3s;
}

/* Mobile menu link hover effects - glassmorphism style */
#menu-mobile a {
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#menu-mobile a::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(168, 85, 247, 0.05) 0%,
    transparent 50%,
    rgba(6, 182, 212, 0.05) 100%
  );
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

#menu-mobile a:hover::before {
  opacity: 1;
}

/* Active link indicator with gradient */
#menu-mobile a:hover {
  background: rgba(168, 85, 247, 0.08);
  border-left: 3px solid transparent;
  border-image: linear-gradient(135deg, #a855f7, #06b6d4) 1;
  transform: translateX(4px);
}

/* Accessibility: Respect prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  #menu-mobile:not(.hidden),
  #menu-mobile:not(.hidden) a {
    animation: none;
    opacity: 1;
    transform: none;
  }

  #menu-btn[aria-expanded="true"] svg,
  #menu-btn[aria-expanded="false"] svg {
    transition: none;
  }

  #menu-btn:hover {
    transform: none;
  }
}

/* ============================================ */
/* ============ 404 PAGE STYLES =============== */
/* ============================================ */

/* 404 Number Animation */
@keyframes float-404 {
  0%,
  100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-20px);
  }
}

@keyframes pulse-glow-404 {
  0%,
  100% {
    filter: drop-shadow(0 0 20px rgba(168, 85, 247, 0.4));
  }
  50% {
    filter: drop-shadow(0 0 40px rgba(168, 85, 247, 0.6));
  }
}

@keyframes fade-slide-up {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.number-404 {
  font-size: 6rem; /* 96px - very small screens */
  animation: float-404 4s ease-in-out infinite,
    pulse-glow-404 3s ease-in-out infinite;
  will-change: transform, filter;
}

@media (min-width: 375px) {
  .number-404 {
    font-size: 8rem; /* 128px - mobile standard */
  }
}

@media (min-width: 768px) {
  .number-404 {
    font-size: 10rem; /* 160px - tablet */
  }
}

@media (min-width: 1024px) {
  .number-404 {
    font-size: 12rem; /* 192px - desktop */
  }
}

.fade-in-up {
  animation: fade-slide-up 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  opacity: 0;
}

.delay-1 {
  animation-delay: 0.2s;
}
.delay-2 {
  animation-delay: 0.4s;
}
.delay-3 {
  animation-delay: 0.6s;
}

/* Responsive prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  .number-404 {
    animation: none;
    filter: drop-shadow(0 0 20px rgba(168, 85, 247, 0.4));
  }
  .fade-in-up {
    animation: none;
    opacity: 1;
  }
}

/* ============================================ */
/* ====== HERO TEXT WRAPPING FIX ============== */
/* ============================================ */

/**
 * Fix for rotating text wrapping on small mobile screens (<640px)
 * Issue: Text like "que Automatiza" was breaking into multiple lines
 * Solution: white-space: nowrap added to #rotating-text above (line 389)
 *           + responsive font-size optimization below for mobile devices
 */

/* ============================================ */
/* === MOBILE TYPOGRAPHY OPTIMIZATION (<640px) */
/* ============================================ */

/**
 * Comprehensive mobile typography scale for screens <640px
 * Aligns with Tailwind's 'sm' breakpoint (640px) for consistent mobile experience
 * Maintains visual hierarchy while optimizing for small screens
 * Eliminates the 447px→448px jump by extending mobile optimization to all true mobile devices
 */

@media (max-width: 639px) {
  /* ========= HERO SECTION ========= */

  /* Hero H1 main text - increased to 40px for stronger impact */
  #inicio h1 {
    font-size: 2.5rem !important; /* 40px - up from 36px */
    line-height: 1.2;
  }

  /* Hero rotating text - MANTENER IGUAL que H1 (respeta diseño desktop) */
  /* NO reducir - el gradiente y animación ya le dan peso visual */

  /* Hero paragraph - reduce from text-xl (20px) to 16px */
  #inicio > div > p {
    font-size: 1rem !important; /* 16px */
    line-height: 1.5;
  }

  /* Hero CTA buttons */
  #inicio a.font-bold,
  #inicio button.font-bold {
    font-size: 0.9375rem !important; /* 15px */
    padding: 0.75rem 1.5rem; /* Adjust padding for smaller text */
  }

  /* Reduce container padding to provide more horizontal space */
  #inicio .container {
    padding-left: 1rem; /* 16px instead of px-6 (24px) */
    padding-right: 1rem;
  }

  /* ========= SECTION TITLES (H2) ========= */

  /* All H2 section titles across the site */
  h2.text-3xl,
  h2[class*="md:text-4xl"],
  h2[class*="lg:text-5xl"],
  section h2 {
    font-size: 1.75rem !important; /* 28px */
    line-height: 1.3;
  }

  /* Section subtitle paragraphs */
  p.text-xl,
  section > div > p.text-xl {
    font-size: 1.125rem !important; /* 18px - down from 20px */
    line-height: 1.6;
  }

  /* ========= CARD TITLES (H3) ========= */

  /* All H3 card titles */
  h3.text-2xl,
  h3[class*="lg:text-3xl"],
  article h3 {
    font-size: 1.375rem !important; /* 22px */
    line-height: 1.4;
  }

  /* Card paragraphs */
  article p.text-lg,
  .card p.text-lg {
    font-size: 1rem !important; /* 16px - down from 18px */
    line-height: 1.6;
  }

  /* ========= STATS SECTION ========= */

  /* Large stat numbers */
  [class*="text-5xl"][class*="lg:text-6xl"],
  .stat-number {
    font-size: 2.5rem !important; /* 40px */
    line-height: 1.1;
  }

  /* Stat labels */
  .stat-label {
    font-size: 1rem !important; /* 16px */
  }

  /* ========= PRICING SECTION ========= */

  /* Pricing H2 title */
  #precios h2 {
    font-size: 1.75rem !important; /* 28px */
  }

  /* Pricing plan names (H3) */
  #precios h3 {
    font-size: 1.25rem !important; /* 20px */
    line-height: 1.3;
  }

  /* Pricing amounts */
  #precios .text-5xl,
  #precios [class*="text-5xl"] {
    font-size: 2rem !important; /* 32px */
    line-height: 1.2;
  }

  /* Pricing features list */
  #precios .text-sm {
    font-size: 0.875rem; /* 14px - keep as is */
  }

  /* Pricing buttons */
  #precios a.font-bold,
  #precios button.font-bold {
    font-size: 0.9375rem !important; /* 15px */
  }

  /* ========= CONTACT FORM SECTION ========= */

  /* Contact H2 title */
  #contacto h2 {
    font-size: 2rem !important; /* 32px */
    line-height: 1.3;
  }

  /* Contact paragraph */
  #contacto p {
    font-size: 1rem !important; /* 16px */
    line-height: 1.6;
  }

  /* Form labels */
  #contacto label {
    font-size: 0.8125rem !important; /* 13px */
  }

  /* Submit button */
  #contacto button[type="submit"] {
    font-size: 0.9375rem !important; /* 15px */
  }

  /* ========= TESTIMONIALS SECTION ========= */

  /* Testimonial quotes */
  #testimonios blockquote,
  #testimonios p.text-lg {
    font-size: 1rem !important; /* 16px */
    line-height: 1.6;
  }

  /* Client names */
  #testimonios .font-semibold {
    font-size: 0.9375rem !important; /* 15px */
  }

  /* ========= FAQ SECTION ========= */

  /* FAQ questions */
  #faq .faq-question h3,
  #faq button h3 {
    font-size: 1.125rem !important; /* 18px */
    line-height: 1.4;
  }

  /* FAQ answers */
  #faq .faq-answer p {
    font-size: 0.9375rem !important; /* 15px */
    line-height: 1.6;
  }

  /* ========= FOOTER ========= */

  /* Footer headings */
  footer h3 {
    font-size: 1.125rem !important; /* 18px */
  }

  /* Footer text */
  footer p,
  footer a {
    font-size: 0.875rem !important; /* 14px */
  }

  /* ========= GLOBAL CTA BUTTONS ========= */

  /* All CTA buttons across sections */
  a.font-bold[class*="bg-gradient"],
  button.font-bold[class*="bg-gradient"],
  .cta-button {
    font-size: 0.9375rem !important; /* 15px */
    padding: 0.75rem 1.5rem !important;
  }
}

/* ========= EXTRA SMALL SCREENS (<375px) ========= */

@media (max-width: 374px) {
  /* Hero H1 - reduce further for very small screens */
  #inicio h1 {
    font-size: 2.25rem !important; /* 36px */
    line-height: 1.2;
  }

  /* Hero rotating text - MANTENER IGUAL que H1 (respeta diseño desktop) */
  /* NO reducir - el gradiente y animación ya le dan peso visual */

  /* Hero paragraph */
  #inicio > div > p {
    font-size: 0.9375rem !important; /* 15px */
  }

  /* Section titles (H2) */
  h2.text-3xl,
  section h2 {
    font-size: 1.5rem !important; /* 24px */
  }

  /* Card titles (H3) */
  h3.text-2xl,
  article h3 {
    font-size: 1.25rem !important; /* 20px */
  }

  /* Contact H2 */
  #contacto h2 {
    font-size: 1.75rem !important; /* 28px */
  }

  /* Reduce container padding further */
  #inicio .container {
    padding-left: 0.75rem; /* 12px - equivalent to px-3 */
    padding-right: 0.75rem;
  }

  /* All containers on extra small screens */
  .container {
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
  }
}
