/* Mejoras de responsividad y corrección de colores para new_register.html */

/* Prevenir overflow en móvil */
@media (max-width: 768px) {
  * {
    box-sizing: border-box;
  }
  
  html, body {
    overflow-x: hidden !important;
    width: 100% !important;
    max-width: 100vw !important;
  }
  
  .animated-background {
    width: 100vw !important;
    max-width: 100vw !important;
    overflow: hidden !important;
  }
}

/* Correcciones globales de overflow */
html, body {
  overflow-x: hidden !important;
}
/* Correcciones de colores de texto */
.card-right .form-group input,
.card-right .form-group select,
.card-right .form-group textarea {
  background: #fff !important;
  color: #333 !important;
  border: 1px solid #ddd !important;
}

.card-right .form-group input::placeholder {
  color: #888 !important;
}

.verification-code-input {
  background: #ffffff !important;
  color: #333333 !important;
  border: 1px solid #e0e0e0 !important;
}

.verification-code-input::placeholder {
  color: #777 !important;
}

/* Corrección para el input de teléfono */
.phone-input-upgrade,
.phone-number {
  background: #ffffff !important;
  color: #333333 !important;
  border: 1px solid #e0e0e0 !important;
}

.phone-input-upgrade::placeholder,
.phone-number::placeholder {
  color: #888 !important;
}

/* Corrección para el selector de país */
.country-code {
  color: #333333 !important;
}

/* Estilos para el toggle de tipo de cuenta */
.account-type-toggle {
  margin-bottom: 25px;
}

.toggle-label {
  display: block;
  color: rgba(255, 255, 255, 0.9);
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: 12px;
  text-align: center;
}

.toggle-container {
  display: flex;
  justify-content: center;
  width: 100%;
}

.toggle-switch {
  position: relative;
  display: flex;
  /* Fondo translúcido + blur para ver el fondo detrás */
  background: rgba(255, 255, 255, 0.10);
  border-radius: 12px;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  width: 280px;
  height: 50px;
  backdrop-filter: saturate(150%) blur(10px);
  -webkit-backdrop-filter: saturate(150%) blur(10px);
}

.toggle-switch input[type="radio"] {
  display: none;
}

.toggle-option {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  /* Inactivo: blanco semitransparente */
  color: rgba(255, 255, 255, 0.8);
  font-weight: 500;
  font-size: 0.9rem;
  /* Elevar el texto por encima del pill */
  z-index: 3;
  position: relative;
}

.toggle-option i {
  font-size: 1.1rem;
}

.toggle-slider {
  position: absolute;
  top: 4px;
  left: 4px;
  /* 3 opciones: ancho a tercio */
  width: calc(33.333% - 4px);
  height: calc(100% - 8px);
  /* Gradiente con alfa para no tapar el fondo */
  background: linear-gradient(135deg, rgba(147, 112, 219, 0.85), rgba(75, 0, 130, 0.85));
  border-radius: 8px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(147, 112, 219, 0.3);
  /* Bajar el highlight por debajo del texto */
  z-index: 0;
  backdrop-filter: saturate(140%) blur(6px);
  -webkit-backdrop-filter: saturate(140%) blur(6px);
}

#teacher-toggle:checked ~ .toggle-switch .toggle-slider {
  transform: translateX(0);
  background: linear-gradient(135deg, rgba(106, 17, 203, 0.85), rgba(37, 117, 252, 0.85));
}

#student-toggle:checked ~ .toggle-switch .toggle-slider {
  transform: translateX(100%);
  background: linear-gradient(135deg, rgba(56, 161, 105, 0.88), rgba(47, 133, 90, 0.88));
  box-shadow: 0 2px 8px rgba(82, 183, 136, 0.3);
}
/* Tercera opción: Familiar */
#parent-toggle:checked ~ .toggle-switch .toggle-slider {
  transform: translateX(200%);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.88), rgba(249, 115, 22, 0.88));
  box-shadow: 0 2px 8px rgba(249, 115, 22, 0.3);
}
/* Activo: texto en blanco sólido sobre el highlight */
#teacher-toggle:checked ~ .toggle-switch label[for="teacher-toggle"],
#student-toggle:checked ~ .toggle-switch label[for="student-toggle"],
#parent-toggle:checked  ~ .toggle-switch label[for="parent-toggle"] {
  color: #ffffff;
  filter: none;
}

#teacher-toggle:checked ~ .toggle-switch label[for="teacher-toggle"] {
  color: #fff;
  font-weight: 600;
}

#student-toggle:checked ~ .toggle-switch label[for="student-toggle"] {
  color: #fff;
  font-weight: 600;
}

.toggle-option:hover {
  color: rgba(255, 255, 255, 0.9);
}

/* Ajustes adicionales de UI */
input[type="radio"][name="account-type"],
input[type="radio"][name="gender"] { 
  display: none !important; 
}

.card-right .form-group label {
  color: #555 !important;
}

.card-right .input-icon {
  color: #8a8a8a !important;
}

.step-content .form-group {
  margin-bottom: 16px;
}

.hidden {
  display: none !important;
}
.verification-badge {
  display: none;
}

/* Estilos para navegación entre pasos */
.step-content {
  display: none;
}

.step-content.active {
  display: block;
}

/* Ocultar números extra que aparecen en los pasos */
.steps-indicator::before,
.step::before,
.step::after {
  display: none !important;
  content: none !important;
}

/* Asegurar que los indicadores de pasos estén por debajo del modal parental */
.steps-indicator, .step, .step-line {
  position: relative;
  z-index: 1 !important;
}

/* Ocultar elementos propensos a filtrarse cuando el modal parental está abierto */
body.no-scroll .steps-indicator,
body.no-scroll .step,
body.no-scroll .step-line,
body.no-scroll .register-footer,
body.no-scroll .register-footer-mobile {
  display: none !important;       /* forzar que NO se rendericen */
  visibility: hidden !important;  /* redundancia por si hay estilos inline */
  opacity: 0 !important;          /* evitar cualquier pintura residual */
  pointer-events: none !important;
}

/* Botones de navegación */
.step-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 24px;
}

.next-button, .back-button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border: none;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.95rem;
}

.next-button {
  background: linear-gradient(135deg, #9370DB, #4b0082);
  color: white;
  order: 1; /* Aparece primero */
  flex: 1;
  justify-content: center;
  min-width: 140px;
}

.next-button:hover {
  background: linear-gradient(135deg, #8a5fd3, #3d006b);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(147, 112, 219, 0.4);
}

.back-button {
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  order: 2; /* Aparece segundo */
  font-size: 0.85rem;
  padding: 10px 16px;
  min-width: 100px;
}

.back-button:hover {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.8);
}

/* Ajustar el contenedor de botones */
.step-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 24px;
  flex-direction: row-reverse; /* Invertir orden visual */
}

/* Estilos para términos y condiciones */
.terms-group {
  margin-bottom: 20px !important;
}

.terms-checkbox-container {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0;               /* Sin padding para quitar “bloque” blanco */
  background: transparent;  /* Quitar fondo */
  border-radius: 0;         /* Sin borde redondeado */
  border: none;             /* Sin borde */
  transition: none;
}

.terms-checkbox-container:hover {
  background: transparent;
  border-color: transparent;
}

#terms_accepted {
  width: 18px;
  height: 18px;
  margin: 0;
  cursor: pointer;
  accent-color: #9370DB;
  flex-shrink: 0;
  margin-top: 2px;
}

.terms-label {
  color: rgba(255, 255, 255, 0.9) !important;
  font-size: 0.9rem;
  line-height: 1.4;
  cursor: pointer;
  margin: 0;
  flex: 1;
  background: transparent !important; /* Asegurar sin bloque */
}

.terms-link {
  color: #72e3a6 !important;
  text-decoration: underline;
  font-weight: 500;
  transition: color 0.2s ease;
}

.terms-link:hover {
  color: #5dd39e !important;
  text-decoration: underline;
}

/* Estilos para el selector de fecha */
input[type="date"] {
  background: #ffffff !important;
  color: #333333 !important;
  border: 1px solid #ddd !important;
  border-radius: 8px;
  padding: 12px 12px 12px 40px;
  font-size: 15px;
  outline: none;
  transition: all 0.3s ease;
  width: 100%;
  font-family: inherit;
}

input[type="date"]:focus {
  border-color: #9370DB;
  box-shadow: 0 0 0 3px rgba(147, 112, 219, 0.1);
}

input[type="date"]::-webkit-calendar-picker-indicator {
  background: transparent;
  bottom: 0;
  color: transparent;
  cursor: pointer;
  height: auto;
  left: 0;
  position: absolute;
  right: 0;
  top: 0;
  width: auto;
}

/* Estilos para el toggle de género */
#male-toggle:checked ~ .toggle-switch .toggle-slider {
  transform: translateX(0);
  background: linear-gradient(135deg, #4a90e2, #357abd);
  box-shadow: 0 2px 8px rgba(74, 144, 226, 0.3);
}

#female-toggle:checked ~ .toggle-switch .toggle-slider {
  transform: translateX(100%);
  background: linear-gradient(135deg, #e91e63, #c2185b);
  box-shadow: 0 2px 8px rgba(233, 30, 99, 0.3);
}

#male-toggle:checked ~ .toggle-switch label[for="male-toggle"] {
  color: #fff;
  font-weight: 600;
}

#female-toggle:checked ~ .toggle-switch label[for="female-toggle"] {
  color: #fff;
  font-weight: 600;
}

/* Botón para mostrar/ocultar contraseña (simple) */
.password-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  appearance: none;
  color: #222 !important; /* forzar color oscuro */
  cursor: pointer;
  width: 36px;              /* asegurar área clickeable visible */
  height: 36px;
  border-radius: 50%;
  padding: 0;
  font-size: 18px;          /* tamaño claro del icono */
  line-height: 36px;        /* centrar verticalmente el ícono */
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;               /* por encima del input */
}

.password-toggle:hover {
  color: #111 !important;
  background: rgba(0,0,0,0.06);
}
.password-toggle i {
  color: inherit !important; /* hereda el color oscuro del contenedor */
  font-size: 18px;
  line-height: 1;
}
.password-toggle:hover i {
  color: inherit !important;
}

.password-toggle:active {
  transform: translateY(-50%) scale(0.95);
}

.form-group {
  position: relative;
}

/* Ajustar padding del input cuando hay botón de contraseña */
.form-group:has(.password-toggle) input {
  padding-right: 40px !important;
}

/* Modal de código - Overlay completo */
.code-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.code-modal.hidden {
  display: none !important;
}

.code-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  animation: fadeIn 0.3s ease-out;
}

.code-modal-content {
  position: relative;
  width: 100%;
  max-width: 450px;
  background: #ffffff;
  color: #1f2937;
  border-radius: 20px;
  padding: 32px 28px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.4);
  border: 1px solid #e5e7eb;
  animation: slideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  transform: translateY(0);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

.code-modal-content h3 {
  margin: 0 0 8px 0;
  font-size: 1.4rem;
  font-weight: 700;
  color: #4b0082;
  text-align: center;
}

.code-modal-desc {
  color: #6b7280;
  font-size: 0.95rem;
  margin-bottom: 24px;
  text-align: center;
  line-height: 1.5;
}

.code-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(0, 0, 0, 0.05);
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.2s ease;
}

.code-modal-close:hover { 
  background: rgba(0, 0, 0, 0.1);
  color: #111827; 
}

/* Entrada de código dentro del modal */
.code-modal .verification-code-input {
  background: #f9fafb !important;
  color: #111 !important;
  border: 2px solid #e5e7eb !important;
  border-radius: 12px !important;
  padding: 16px !important;
  font-size: 1.1rem !important;
  text-align: center !important;
  letter-spacing: 3px !important;
  font-weight: 600 !important;
  transition: all 0.3s ease !important;
}

.code-modal .verification-code-input:focus {
  border-color: #4b0082 !important;
  box-shadow: 0 0 0 3px rgba(75, 0, 130, 0.1) !important;
}

.code-modal .verification-code-container {
  gap: 16px !important;
  margin-bottom: 20px;
}

.code-modal .timer-chip {
  background: #f3f4f6;
  color: #4b5563;
  border-radius: 20px;
  padding: 8px 16px;
  font-weight: 500;
}

.code-modal .btn {
  background: linear-gradient(135deg, #4b0082, #9370DB) !important;
  border: none !important;
  border-radius: 12px !important;
  padding: 14px 24px !important;
  font-weight: 600 !important;
  transition: all 0.3s ease !important;
  color: #ffffff !important;
}

.code-modal .btn:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 8px 25px rgba(75, 0, 130, 0.3) !important;
}

@media (max-width: 480px) {
  .code-modal {
    padding: 16px;
  }
  
  .code-modal-content {
    padding: 24px 20px;
    border-radius: 16px;
  }
  
  .code-modal-content h3 {
    font-size: 1.2rem;
  }
  
  .code-modal .verification-code-container {
    flex-direction: column !important;
    align-items: stretch !important;
  }
}

/* Estilos para estado verificado moderno */
.verified-success {
  background: linear-gradient(135deg, #10b981, #059669) !important;
  color: white !important;
  border: none !important;
  animation: successPulse 0.6s ease-out;
}

@keyframes successPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.verification-badge.verified {
  background: linear-gradient(135deg, #10b981, #059669) !important;
  color: white !important;
  animation: verifiedGlowAppear 1s ease-out;
  margin: 15px auto !important;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  width: fit-content !important;
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.6) !important;
  position: relative !important;
}

.verification-badge.verified::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(45deg, #10b981, #059669, #10b981);
  border-radius: inherit;
  z-index: -1;
  animation: glowPulse 2s ease-in-out infinite;
}

@keyframes verifiedGlowAppear {
  0% {
    opacity: 0;
    transform: scale(0.8);
    box-shadow: 0 0 0 rgba(16, 185, 129, 0);
  }
  50% {
    transform: scale(1.1);
    box-shadow: 0 0 30px rgba(16, 185, 129, 0.8);
  }
  100% {
    opacity: 1;
    transform: scale(1);
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.6);
  }
}

@keyframes glowPulse {
  0%, 100% {
    opacity: 0.8;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.02);
  }
}

/* Contenedor para centrar el badge */
.verification-badge-container {
  display: flex !important;
  justify-content: center !important;
  width: 100% !important;
  margin: 15px 0 !important;
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Botón "Crear Cuenta" llamativo */
.create-account-highlight {
  background: linear-gradient(135deg, #f59e0b, #d97706) !important;
  color: white !important;
  border: none !important;
  box-shadow: 0 8px 25px rgba(245, 158, 11, 0.4) !important;
  animation: createAccountAppear 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;
}

.create-account-highlight::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  animation: shimmer 2s infinite;
}

@keyframes createAccountAppear {
  0% {
    opacity: 0;
    transform: translateY(20px) scale(0.9);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes shimmer {
  0% { left: -100%; }
  100% { left: 100%; }
}

.create-account-highlight:hover {
  transform: translateY(-3px) !important;
  box-shadow: 0 12px 35px rgba(245, 158, 11, 0.5) !important;
}

/* Mejoras de responsividad */
@media (max-width: 1024px) {
  .register-card {
    width: 95%;
    max-width: 800px;
    height: auto;
    max-height: 95vh;
  }
  
  .card-inner {
    flex-direction: column;
  }
  
  .card-left {
    padding: 25px;
    min-height: 250px;
    flex: none;
  }
  
  .image-container {
    height: 200px;
    margin: 15px 0;
  }
  
  .brand-logo {
    width: 150px;
  }
  
  .card-right {
    padding: 25px;
    flex: none;
  }
  
  .register-header h1 {
    font-size: 2rem;
  }
  
  .step-title h2 {
    font-size: 1.5rem;
  }
}

@media (max-width: 768px) {
  body {
    overflow-y: auto;
    overflow-x: hidden; /* Evitar scroll horizontal */
    align-items: flex-start;
    padding: 10px 0;
    min-height: 100vh;
  }
  
  .register-card {
    width: 100%;
    max-width: 100vw;
    margin: 0;
    height: auto;
    max-height: none;
    border-radius: 0; /* Sin bordes redondeados en móvil para aprovechar todo el espacio */
  }
  
  .card-left {
    padding: 15px;
    min-height: 80px; /* Más compacto para móvil */
  }
  
  .brand {
    margin-top: 5px;
    margin-bottom: 10px;
  }
  
  .brand-logo {
    width: 100px;
  }
  
  /* Ocultar imagen en móvil */
  .image-container {
    display: none;
  }
  
  /* Ocultar completamente la frase en móvil */
  .quote-container,
  .quote-text {
    display: none !important;
  }
  
  /* Ajustes para el toggle en tablet */
  .toggle-switch {
    width: 260px;
    height: 45px;
  }
  
  .toggle-label {
    font-size: 0.95rem;
  }
  
  .toggle-option {
    font-size: 0.85rem;
    gap: 6px;
  }
  
  .toggle-option i {
    font-size: 1rem;
  }
  
  .card-right {
    padding: 20px;
  }
  
  .register-header {
    margin-bottom: 20px;
    text-align: center;
  }
  
  .register-header h1 {
    font-size: 1.8rem;
  }
  
  .register-header p {
    font-size: 0.9rem;
  }
  
  .step-title {
    margin-bottom: 20px;
  }
  
  .step-title h2 {
    font-size: 1.4rem;
  }
  
  .step-title p {
    font-size: 0.85rem;
  }
  
  .form-group {
    margin-bottom: 15px;
  }
  
  .form-group input,
  .form-group select {
    padding: 12px 12px 12px 40px;
    font-size: 16px; /* Evita zoom en iOS */
  }
  
  .input-icon {
    left: 12px;
  }
  
  .form-group label {
    left: 40px;
    font-size: 0.9rem;
  }
  
  .phone-label-container {
    margin-top: 15px;
    margin-bottom: 8px;
  }
  
  .standalone-label {
    font-size: 0.9rem;
  }
  
  .steps-indicator {
    margin-bottom: 20px;
  }
  
  .step {
    width: 35px;
    height: 35px;
    font-size: 0.9rem;
  }
  
  .register-button,
  .next-button,
  .back-button {
    padding: 12px 20px;
    font-size: 0.95rem;
  }
  
  .register-footer {
    margin-top: 20px;
    flex-direction: column;
    gap: 5px;
  }
  
  .register-footer p,
  .register-footer a {
    font-size: 0.85rem;
  }
}

@media (max-width: 480px) {
  body {
    padding: 0;
    overflow-x: hidden;
  }
  
  .register-card {
    width: 100%;
    max-width: 100vw;
    margin: 0;
    border-radius: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
  }
  
  .card-inner {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
  }
  
  .card-left {
    padding: 10px 15px;
    min-height: 60px; /* Muy compacto en móvil */
    flex: none;
  }
  
  .brand {
    margin: 5px 0;
  }
  
  .brand-logo {
    width: 80px;
  }
  
  /* Asegurar que imagen y frase estén ocultas */
  .image-container,
  .quote-container,
  .quote-text {
    display: none !important;
  }
  
  /* Ajustes del toggle para móvil */
  .toggle-switch {
    width: 240px;
    height: 42px;
  }
  
  .toggle-label {
    font-size: 0.9rem;
    margin-bottom: 10px;
  }
  
  .toggle-option {
    font-size: 0.8rem;
    gap: 4px;
    padding: 6px 12px;
  }
  
  .toggle-option i {
    font-size: 0.9rem;
  }
  
  .toggle-option span {
    display: block; /* Asegurar que el texto se muestre */
  }
  
  .card-right {
    padding: 15px;
  }
  
  .register-header h1 {
    font-size: 1.6rem;
  }
  
  .register-header p {
    font-size: 0.85rem;
  }
  
  .step-title h2 {
    font-size: 1.2rem;
  }
  
  .step-title p {
    font-size: 0.8rem;
  }
  
  .form-group input,
  .form-group select {
    padding: 10px 10px 10px 35px;
    font-size: 16px;
  }
  
  .input-icon {
    left: 10px;
    font-size: 0.9rem;
  }
  
  .form-group label {
    left: 35px;
    font-size: 0.85rem;
  }
  
  .phone-label-container {
    margin-top: 12px;
    margin-bottom: 6px;
  }
  
  .standalone-label {
    font-size: 0.85rem;
  }
  
  .step {
    width: 30px;
    height: 30px;
    font-size: 0.8rem;
  }
  
  .register-button,
  .next-button,
  .back-button {
    padding: 10px 15px;
    font-size: 0.9rem;
    border-radius: 10px;
  }
  
  .help-text {
    font-size: 0.75rem;
    padding-left: 35px;
  }
  
  /* Ajustes específicos para el campo de teléfono en móvil */
  .phone-input-field {
    border-radius: 10px;
  }
  
  .country-selector {
    min-width: 45px;
    max-width: 45px;
    padding: 6px 2px;
  }
  
  .country-flag {
    width: 16px;
    height: 10px;
  }
  
  .country-code {
    font-size: 10px;
  }
  
  .country-arrow {
    font-size: 6px;
  }
  
  .phone-number {
    padding: 10px 6px 10px 8px;
    font-size: 16px;
  }
  
  .country-dropdown {
    width: 280px;
    max-width: 90vw;
    left: 50%;
    transform: translateX(-50%);
  }
  
  /* Ajustes para la sección de verificación */
  .verification-code-container {
    flex-direction: column;
    gap: 10px !important;
    align-items: stretch !important;
  }
  
  .verification-code-input {
    max-width: none !important;
    width: 100%;
    text-align: center;
    font-size: 18px;
    padding: 12px;
    letter-spacing: 2px;
  }
  
  .timer-chip {
    align-self: center;
    font-size: 0.8rem;
  }
}

@media (max-width: 360px) {
  .register-card {
    width: 100%;
    max-width: 100vw;
    margin: 0;
    border-radius: 0;
    min-height: 100vh;
  }
  
  .card-left {
    padding: 8px 12px;
    min-height: 50px;
  }
  
  .card-right {
    padding: 12px;
    flex: 1;
  }
  
  .brand-logo {
    width: 70px;
  }
  
  /* Asegurar que imagen y frase estén completamente ocultas */
  .image-container,
  .quote-container,
  .quote-text {
    display: none !important;
  }
  
  .register-header h1 {
    font-size: 1.4rem;
  }
  
  .step-title h2 {
    font-size: 1.1rem;
  }
  
  .step-title p {
    font-size: 0.75rem;
    line-height: 1.3;
  }
  
  .form-group input,
  .form-group select {
    padding: 8px 8px 8px 30px;
  }
  
  .input-icon {
    left: 8px;
    font-size: 0.8rem;
  }
  
  .form-group label {
    left: 30px;
    font-size: 0.8rem;
  }
  
  .country-dropdown {
    width: 260px;
  }
  
  /* Toggle más pequeño para pantallas muy pequeñas */
  .toggle-switch {
    width: 220px;
    height: 38px;
  }
  
  .toggle-option {
    font-size: 0.75rem;
    gap: 3px;
    padding: 4px 8px;
  }
  
  .toggle-option i {
    font-size: 0.8rem;
  }
  
  .toggle-label {
    font-size: 0.85rem;
  }
  
  /* Mejorar legibilidad del texto de ayuda */
  .help-text {
    font-size: 0.7rem;
    line-height: 1.3;
    padding-left: 30px;
    margin-top: 12px;
  }
}

/* Mejoras para la accesibilidad táctil */
@media (hover: none) and (pointer: coarse) {
  .register-button,
  .next-button,
  .back-button {
    min-height: 44px; /* Tamaño mínimo recomendado para elementos táctiles */
  }
  
  .country-selector {
    min-height: 44px;
  }
  
  .country-item {
    min-height: 44px;
    padding: 12px 16px;
  }
  
  .form-group input,
  .form-group select {
    min-height: 44px;
  }
}

/* Correcciones adicionales para el contraste */
.form-text {
  color: rgba(255, 255, 255, 0.8) !important;
}

.form-text.text-success {
  color: #72e3a6 !important;
}

.form-text.text-danger {
  color: #ff6b6b !important;
}

.form-text.text-muted {
  color: rgba(255, 255, 255, 0.6) !important;
}

/* Mejoras para el fondo animado en móvil */
@media (max-width: 768px) {
  .floating-elements {
    display: none; /* Ocultar elementos flotantes en móvil para mejor rendimiento */
  }
  
  .particles::before {
    animation-duration: 120s; /* Ralentizar animación en móvil */
  }
  
  .gradient-bg {
    animation-duration: 30s; /* Ralentizar gradiente en móvil */
  }
}

/* Corrección para el dropdown de países en modo oscuro */
.country-dropdown {
  background-color: rgba(255, 255, 255, 0.95) !important;
  border: 1px solid rgba(0, 0, 0, 0.1) !important;
}

.country-search-container {
  background-color: rgba(255, 255, 255, 0.95) !important;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1) !important;
}

.country-search {
  background-color: #f8f9fa !important;
  color: #333 !important;
  border: 1px solid #ddd !important;
}

.country-item-name,
.country-item-code {
  color: #333 !important;
}

.country-item:hover {
  background-color: rgba(147, 112, 219, 0.1) !important;
}

.country-item.selected {
  background-color: rgba(147, 112, 219, 0.2) !important;
}

/* Scrollbar para el dropdown en móvil */
.country-list::-webkit-scrollbar {
  width: 6px;
}

.country-list::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
}

.country-list::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 3px;
}

/* Ajustes adicionales para evitar overflow en móvil */
@media (max-width: 768px) {
  /* Asegurar que todos los elementos se contengan dentro del viewport */
  .register-card * {
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Ajustar el contenedor principal para que ocupe toda la pantalla */
  .card-inner {
    width: 100% !important;
    max-width: 100vw !important;
  }
  
  /* Asegurar que los formularios no se desborden */
  .register-form {
    width: 100% !important;
    max-width: 100% !important;
  }
  
  /* Ajustar los botones para que no se desborden */
  .step-buttons {
    width: 100% !important;
    max-width: 100% !important;
    flex-wrap: wrap !important;
  }
  
  .step-buttons .next-button,
  .step-buttons .back-button,
  .step-buttons .register-button {
    min-width: 0 !important;
    flex: 1 1 auto !important;
  }
  
  /* Ajustar el toggle para pantallas pequeñas */
  .toggle-container {
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
  }
  
  .toggle-switch {
    max-width: calc(100vw - 40px) !important;
  }
}

@media (max-width: 480px) {
  /* Ajustes específicos para móviles muy pequeños */
  .toggle-switch {
    width: calc(100vw - 60px) !important;
    max-width: 280px !important;
  }
  
  /* Asegurar que los inputs no se desborden */
  .form-group input,
  .form-group select {
    width: 100% !important;
    max-width: 100% !important;
  }
  
  /* Ajustar el modal para pantallas pequeñas */
  .code-modal-content {
    width: calc(100vw - 32px) !important;
    max-width: calc(100vw - 32px) !important;
    margin: 0 16px !important;
  }
}

@media (max-width: 360px) {
  /* Ajustes para pantallas muy pequeñas */
  .toggle-switch {
    width: calc(100vw - 80px) !important;
    max-width: 240px !important;
  }
  
  .card-right {
    padding: 10px !important;
  }
  
  .form-group {
    margin-bottom: 12px !important;
  }
  
  .step-buttons {
    gap: 8px !important;
  }
}

/* Reglas adicionales para prevenir overflow horizontal */
@media (max-width: 768px) {
  body, html {
    position: relative !important;
    overflow-x: hidden !important;
  }
  
  .register-card,
  .card-inner,
  .card-left,
  .card-right {
    overflow-x: hidden !important;
  }
  
  /* Asegurar que ningún elemento se salga del contenedor */
  * {
    max-width: 100% !important;
  }
  
  /* Excepciones para elementos que necesitan mantener su ancho */
  .toggle-slider,
  .step,
  .input-icon,
  .password-toggle {
    max-width: none !important;
  }
}
