/* ============================================ */
/* FONDO CIENTÍFICO - ICONOS TEMÁTICOS */
/* ============================================ */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body.register-page {
  font-family: 'Sora', sans-serif;
  height: auto !important;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  position: relative;
  background: linear-gradient(135deg, #0a0e27 0%, #1a3a8f 50%, #0f172a 100%);
  background-size: 200% 200%;
  animation: gradientBG 10s ease infinite;
  overflow-y: auto !important;
  overflow-x: hidden;
}

@keyframes gradientBG {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Grid de puntos científicos */
body.register-page::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: radial-gradient(rgba(255,255,255,0.08) 1px, transparent 1px);
  background-size: 35px 35px;
  pointer-events: none;
  z-index: 1;
}

/* Brillo pulsante */
body.register-page::after {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 50% 50%, rgba(26,86,219,0.12) 0%, transparent 70%);
  pointer-events: none;
  z-index: 1;
  animation: pulse 5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.8; }
}

/* Contenedor de iconos científicos */
.particles-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
  overflow: hidden;
}

/* Iconos científicos flotantes */
.science-icon {
  position: absolute;
  font-size: 24px;
  opacity: 0;
  animation: floatIcon linear infinite;
  filter: drop-shadow(0 0 5px rgba(26,86,219,0.5));
}

@keyframes floatIcon {
  0% {
    transform: translateY(100vh) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 0.7;
  }
  90% {
    opacity: 0.5;
  }
  100% {
    transform: translateY(-20vh) rotate(360deg);
    opacity: 0;
  }
}

/* Icono de ADN */
.dna-icon {
  position: absolute;
  font-size: 30px;
  opacity: 0;
  animation: floatDNA linear infinite;
  filter: drop-shadow(0 0 8px rgba(124,58,237,0.6));
}

@keyframes floatDNA {
  0% {
    transform: translateY(100vh) translateX(0) scale(1);
    opacity: 0;
  }
  20% {
    opacity: 0.8;
  }
  80% {
    opacity: 0.6;
  }
  100% {
    transform: translateY(-20vh) translateX(50px) scale(1.2);
    opacity: 0;
  }
}

/* ============================================ */
/* TARJETA DE REGISTRO (CRISTAL) */
/* ============================================ */
.reg-wrap {
  position: relative;
  z-index: 100;
  width: 100%;
  max-width: 540px;
  animation: slideUp 0.5s ease both;
}

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

.reg-card {
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(10px);
  border-radius: 24px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.reg-card-accent {
  height: 4px;
  background: linear-gradient(90deg, #1a56db, #7c3aed, #06b6d4, #f59e0b, #1a56db);
  background-size: 300% 100%;
  animation: accentMove 4s ease infinite;
}

@keyframes accentMove {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.reg-card-body {
  padding: 32px 28px 28px;
}

/* Logo */
.reg-logo-wrap {
  text-align: center;
  margin-bottom: 20px;
}

.reg-logo-ring {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 75px;
  height: 75px;
  background: linear-gradient(135deg, #1a56db, #7c3aed);
  border-radius: 50%;
  padding: 3px;
  box-shadow: 0 8px 20px rgba(26,86,219,0.4);
  transition: transform 0.3s;
}

.reg-logo-ring:hover {
  transform: scale(1.05);
}

.reg-logo-ring img {
  width: 69px;
  height: 69px;
  border-radius: 50%;
  object-fit: cover;
  background: white;
  border: 3px solid white;
}

.reg-title {
  font-size: 1.25rem;
  font-weight: 800;
  text-align: center;
  color: #0f172a;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.reg-title i {
  color: #1a56db;
}

.reg-subtitle {
  text-align: center;
  font-size: 0.75rem;
  color: #64748b;
  margin-bottom: 20px;
}

/* Step badge */
.reg-step-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-bottom: 24px;
  padding: 6px 12px;
  background: #f1f5f9;
  border-radius: 40px;
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
}

.step-dot {
  width: 24px;
  height: 24px;
  background: #1a56db;
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}

.step-line {
  width: 30px;
  height: 2px;
  background: #cbd5e1;
}

.step-label {
  font-size: 11px;
  font-weight: 600;
  color: #1e293b;
}

/* Alertas */
.reg-alert {
  padding: 12px 16px;
  margin-bottom: 20px;
  border-radius: 12px;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 8px;
  border-left: 4px solid;
}

.reg-alert.alert-danger {
  background: #fef2f2;
  border-color: #ef4444;
  color: #991b1b;
}

.reg-alert.alert-success {
  background: #ecfdf5;
  border-color: #10b981;
  color: #065f46;
}

.reg-alert.alert-ratelimit {
  background: #fef3c7;
  border-color: #f59e0b;
  color: #78350f;
}

/* Campos de formulario */
.fields-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.field-group {
  margin-bottom: 0;
}

.field-group.full {
  grid-column: span 2;
}

.field-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.field-wrap {
  display: flex;
  align-items: center;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
  transition: all 0.2s;
}

.field-wrap:focus-within {
  border-color: #1a56db;
  background: white;
  box-shadow: 0 0 0 3px rgba(26,86,219,0.1);
}

.field-wrap.is-invalid {
  border-color: #ef4444;
  background: #fef2f2;
}

.field-wrap.is-valid {
  border-color: #10b981;
  background: #ecfdf5;
}

.field-icon {
  width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  font-size: 1rem;
}

.field-input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-size: 0.9rem;
  color: #0f172a;
  height: 46px;
  padding-right: 12px;
}

.field-input::placeholder {
  color: #94a3b8;
  font-size: 0.85rem;
}

.field-toggle {
  width: 44px;
  height: 46px;
  border: none;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  cursor: pointer;
}

.field-toggle:hover {
  color: #1a56db;
}

.field-error {
  font-size: 0.7rem;
  color: #ef4444;
  margin-top: 6px;
  display: none;
}

/* Strength bar */
.strength-bar {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.strength-seg {
  flex: 1;
  height: 4px;
  background: #e2e8f0;
  border-radius: 4px;
  transition: all 0.2s;
}

.strength-label {
  font-size: 0.7rem;
  margin-top: 4px;
  color: #64748b;
}

/* Terms */
.terms-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
}

.terms-wrap input {
  width: 18px;
  height: 18px;
  accent-color: #1a56db;
  cursor: pointer;
}

.terms-wrap label {
  font-size: 0.8rem;
  color: #475569;
}

.terms-wrap a {
  color: #1a56db;
  text-decoration: none;
}

.terms-wrap a:hover {
  text-decoration: underline;
}

/* Botones */
.btn-register {
  width: 100%;
  height: 48px;
  background: linear-gradient(135deg, #1a56db, #7c3aed);
  border: none;
  border-radius: 12px;
  color: white;
  font-weight: 700;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(26,86,219,0.3);
  margin-top: 20px;
}

.btn-register:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(26,86,219,0.4);
}

.btn-register:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.reg-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0 16px;
  color: #94a3b8;
  font-size: 0.7rem;
}

.reg-divider::before,
.reg-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #e2e8f0;
}

.btn-to-login {
  width: 100%;
  height: 44px;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  background: white;
  color: #0f172a;
  font-size: 0.8rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-to-login:hover {
  border-color: #1a56db;
  color: #1a56db;
  background: #eff6ff;
}

/* Footer */
.reg-card-footer {
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.sys-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #eff6ff;
  color: #1a56db;
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 0.65rem;
  font-weight: 700;
}

/* Loading */
#loading {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 16px;
}

#loading .spin-ring {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.2);
  border-top-color: white;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Responsive */
/* Responsive para tablets y móviles */
@media (max-width: 560px) {
  body.register-page {
    display: block !important;
    padding: 16px;
    overflow-y: auto !important;
    overflow-x: hidden;
    height: auto !important;
    min-height: 100vh;
    -webkit-overflow-scrolling: touch;
  }
  .reg-wrap {
    margin: 0 auto;
  }
  .reg-card-body {
    padding: 24px 20px;
  }
  .fields-grid {
    grid-template-columns: 1fr;  /* ← Cambia a 1 columna en móvil */
    gap: 16px;
  }
  .field-group.full {
    grid-column: span 1;
  }
  .reg-step-badge {
    display: none;  /* ← Oculta el indicador de pasos en móvil */
  }
  .field-input {
    font-size: 16px;  /* ← Evita zoom automático en iOS */
  }
  .science-icon, .dna-icon {
    font-size: 18px !important;
  }
}

@media (max-width: 380px) {
  .reg-card-body {
    padding: 20px 16px;
  }
  .reg-title {
    font-size: 1.1rem;
  }
  .btn-register {
    height: 44px;
    font-size: 0.85rem;
  }
}