html { scroll-behavior: smooth; }
body { background-color: #0F172A; color: #e1e2ed; min-height: 100vh; display: flex; flex-direction: column; }
.tech-pattern { background-image: linear-gradient(to right, rgba(67, 70, 85, 0.1) 1px, transparent 1px), linear-gradient(to bottom, rgba(67, 70, 85, 0.1) 1px, transparent 1px); background-size: 40px 40px; }
.glass-card { background: rgba(30, 41, 59, 0.7); backdrop-filter: blur(12px); border: 1px solid rgba(141, 144, 160, 0.1); }
.primary-gradient-text { background: linear-gradient(135deg, #2563eb, #38BDF8); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.glow-hover:hover { box-shadow: 0 0 20px rgba(56, 189, 248, 0.2); }
#mobile-menu:not(.open) { display: none; }
@media (min-width: 768px) { #mobile-menu { display: none !important; } }

.success-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(3px);
  z-index: 9999;
  padding: 1rem;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.success-dialog {
  width: min(100%, 420px);
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid rgba(96, 165, 250, 0.4);
  border-radius: 20px;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.45);
  padding: 1.5rem 1.4rem;
  text-align: center;
  transform: translateY(-10px) scale(0.98);
  transition: transform 0.25s ease;
}

.success-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.18), rgba(59, 130, 246, 0.22));
  border: 1px solid rgba(103, 232, 249, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem auto;
  color: #7dd3fc;
  box-shadow: 0 0 0 6px rgba(125, 211, 252, 0.08);
}

.success-icon-svg {
  font-size: 2rem;
}

.success-title {
  margin: 0 0 0.75rem;
  color: #f8fafc;
  font-size: clamp(1.35rem, 3vw, 1.8rem);
  line-height: 1.3;
  font-weight: 700;
}

.success-close {
  width: 100%;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #38bdf8, #2563eb);
  color: #eff6ff;
  font-weight: 600;
  font-size: 0.96rem;
  padding: 0.8rem 1rem;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.25);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.send-icon {
  font-variation-settings: 'FILL' 0;
}

@keyframes submit-bounce {
  0%, 100% { transform: translateY(0); }
  25% { transform: translateY(-4px); }
  50% { transform: translateY(2px); }
  75% { transform: translateY(-2px); }
}

@keyframes submit-alert {
  0%, 100% {
    background: linear-gradient(135deg, #2563eb, #38BDF8);
    box-shadow: 0 0 20px rgba(56, 189, 248, 0.2);
    border-color: rgba(96, 165, 250, 0.35);
  }
  20%, 60% {
    background: linear-gradient(135deg, rgba(254, 202, 202, 0.92), rgba(220, 38, 38, 0.8));
    border-color: rgba(239, 68, 68, 0.9);
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.12), 0 0 18px rgba(239, 68, 68, 0.22);
  }
  40% {
    background: linear-gradient(135deg, rgba(253, 164, 175, 0.9), rgba(220, 38, 38, 0.82));
    border-color: rgba(239, 68, 68, 1);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1), 0 0 22px rgba(239, 68, 68, 0.35);
  }
}

@keyframes submit-border-trace {
  0% {
    opacity: 0;
    transform: scale(0.97);
  }
  15% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: scale(1.03);
  }
}

.submit-alert {
  position: relative;
  border: 1px solid rgba(239, 68, 68, 0.9);
  animation: submit-bounce 0.48s ease-in-out 2, submit-alert 1s ease-in-out 1;
}

.submit-alert::before {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  border: 1px solid rgba(239, 68, 68, 0.95);
  opacity: 0;
  animation: submit-border-trace 0.9s ease-out 1;
  pointer-events: none;
}

/* Mantener borde rojo cuando el campo inválido recibe focus.
   No debe cambiar a blanco/azul por recibir focus; el borde permanece
   rojo hasta que el usuario introduzca el primer carácter válido. */
input.border-red-500:focus,
textarea.border-red-500:focus,
select.border-red-500:focus {
  border-color: #ef4444 !important; /* red-500 */
  box-shadow: 0 0 0 1px rgba(239,68,68,0.12) !important;
  outline: none !important;
}
