/*
  Estilos para login.html y detector.html.
  Reutiliza a propósito lo ya definido en styles.css (paleta, tipografías,
  .framed-box, inputs de .contact-form, .btn-animado): aquí solo se agrega
  lo que falta: el layout de página completa, el toggle Acceder/Crear cuenta,
  los mensajes de error/éxito y el botón de acceso del navbar.
*/

.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6rem 1.5rem 3rem;
  background-color: #0d0f11;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  text-align: center;
}

.auth-card h1 {
  font-size: clamp(1.5rem, 4vw, 2rem);
  margin-bottom: 0.5rem;
  background: linear-gradient(90deg, #aaa, #fff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.auth-card .auth-subtitle {
  color: #ccc;
  font-size: 0.95rem;
  margin-bottom: 2rem;
}

/* Toggle Acceder / Crear cuenta */
.auth-tabs {
  display: flex;
  gap: 0.5rem;
  background-color: rgba(255, 255, 255, 0.06);
  border-radius: 30px;
  padding: 5px;
  margin-bottom: 2rem;
}

.auth-tab {
  flex: 1;
  padding: 0.6rem 1rem;
  border: none;
  border-radius: 24px;
  background: transparent;
  color: #ccc;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.auth-tab.active {
  background-color: #fff;
  color: #1a1a1a;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.auth-form input {
  background: #1e1e1e;
  border: 1px solid #333;
  border-radius: 8px;
  padding: 1rem;
  color: white;
  font-size: 1rem;
  width: 100%;
  font-family: 'Space Grotesk', sans-serif;
  text-align: center;
}

.auth-form input:focus {
  border-color: #00e1ff;
  outline: none;
}

/* Campo de contraseña con botón de ojo (mostrar/ocultar) */
.password-field {
  position: relative;
}

.password-field input {
  padding-right: 2.75rem;
}

/* Oculta el "ojito" nativo de Edge para no duplicarlo con el propio */
.password-field input::-ms-reveal,
.password-field input::-ms-clear {
  display: none;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 0.75rem;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  border: none;
  background: transparent;
  color: #00e1ff;
  cursor: pointer;
  opacity: 0.85;
  transition: opacity 0.2s ease;
}

.password-toggle:hover,
.password-toggle:focus-visible {
  opacity: 1;
}

.password-toggle svg {
  width: 1.25rem;
  height: 1.25rem;
}

.password-toggle .icon-eye-off {
  display: none;
}

.password-toggle.showing .icon-eye {
  display: none;
}

.password-toggle.showing .icon-eye-off {
  display: block;
}

.auth-select {
  background: #1e1e1e;
  border: 1px solid #333;
  border-radius: 8px;
  padding: 1rem;
  color: white;
  font-size: 1rem;
  width: 100%;
  font-family: 'Space Grotesk', sans-serif;
  text-align: center;
  text-align-last: center;
}

.auth-select:focus {
  border-color: #00e1ff;
  outline: none;
}

.auth-phone-row {
  display: flex;
  gap: 0.5rem;
}

.auth-phone-prefix {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 3.5rem;
  background: #1e1e1e;
  border: 1px solid #333;
  border-radius: 8px;
  padding: 1rem 0.75rem;
  color: #ccc;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1rem;
}

.auth-phone-row input {
  flex: 1;
  min-width: 0;
}

/* Indicador de requisitos de contraseña (login.html, formulario de registro) */
.password-reqs {
  list-style: none;
  margin: -0.5rem 0 0;
  padding: 0;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.password-reqs li {
  font-size: 0.8rem;
  color: #888;
  transition: color 0.2s ease;
}

.password-reqs li::before {
  content: "○ ";
}

.password-reqs li.cumple {
  color: #2ecc71;
}

.password-reqs li.cumple::before {
  content: "✓ ";
}

.password-reqs li.no-cumple {
  color: #ff5c5c;
}

.password-reqs li.no-cumple::before {
  content: "✕ ";
}

.auth-form button[type="submit"] {
  margin-top: 0.5rem;
  align-self: center;
  padding: 0.9rem 2.5rem;
}

.auth-forgot {
  display: inline-block;
  margin-top: 1.25rem;
  color: #00e1ff;
  font-size: 0.85rem;
  text-decoration: none;
}

.auth-forgot:hover {
  text-decoration: underline;
}

/* Botón de acceso en el navbar */
.btn-acceso {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
  color: #0d0f11 !important;
  background-color: #00e1ff;
  padding: 8px 20px !important;
  border-radius: 20px;
  font-weight: 700;
  transition: box-shadow 0.3s ease, transform 0.2s ease;
}

.btn-acceso:hover {
  background-color: #00e1ff !important;
  color: #0d0f11 !important;
  box-shadow: 0 0 15px rgba(0, 225, 255, 0.6);
  transform: translateY(-1px);
}

/* Menú desplegable "Explorar" del navbar */
.nav-dropdown {
  position: relative;
  display: inline-block;
}

.nav-dropdown-toggle {
  color: white;
  background: none;
  border: none;
  cursor: pointer;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 1rem;
  padding: 8px 16px;
  border-radius: 20px;
  transition: background-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
  /* Pulso de resplandor cyan para llamar la atención */
  animation: explorarPulso 2.4s ease-in-out infinite;
}

/* Late en cyan de forma continua: nunca se apaga del todo.
   Pulsa el halo (box-shadow) y también el brillo del texto (text-shadow). */
@keyframes explorarPulso {
  0%, 100% {
    box-shadow: 0 0 8px rgba(0, 225, 255, 0.4);
    text-shadow: 0 0 4px rgba(0, 225, 255, 0.4);
  }
  50% {
    box-shadow: 0 0 22px 2px rgba(0, 225, 255, 0.85);
    text-shadow: 0 0 10px rgba(0, 225, 255, 0.9);
  }
}

/* Al pasar el cursor o abrir el menú, se detiene el pulso y se resalta en blanco */
.nav-dropdown-toggle:hover,
.nav-dropdown.open .nav-dropdown-toggle {
  background-color: white;
  color: #1a1a1a;
  animation: none;
  box-shadow: none;
  text-shadow: none;
}

.nav-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 8px;
  min-width: 170px;
  background-color: rgba(13, 15, 17, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 6px;
  display: none;
  flex-direction: column;
  gap: 2px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  z-index: 1200;
}

.nav-dropdown.open .nav-dropdown-menu {
  display: flex;
}

/* Abrir al pasar el cursor (solo en dispositivos con hover, p. ej. escritorio) */
@media (hover: hover) and (min-width: 769px) {
  .nav-dropdown:hover .nav-dropdown-menu {
    display: flex;
  }

  .nav-dropdown:hover .nav-dropdown-toggle {
    background-color: white;
    color: #1a1a1a;
  }

  /* Puente invisible sobre el hueco, para no perder el hover al bajar el cursor */
  .nav-dropdown-menu::before {
    content: "";
    position: absolute;
    top: -8px;
    left: 0;
    right: 0;
    height: 8px;
  }
}

.nav-dropdown-menu a {
  color: #eee;
  text-decoration: none;
  font-weight: 500;
  padding: 10px 14px;
  border-radius: 8px;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.nav-dropdown-menu a:hover {
  background-color: rgba(0, 225, 255, 0.12);
  color: #00e1ff;
}

/* Botón destacado "Mi espacio" (se inyecta cuando hay sesión) */
.nav-dropdown-menu a.explorar-mi-espacio {
  background-color: #00e1ff;
  color: #0d0f11;
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: 0.8rem;
  text-align: center;
  transition: box-shadow 0.2s ease;
}

.nav-dropdown-menu a.explorar-mi-espacio:hover {
  background-color: #00e1ff;
  color: #0d0f11;
  box-shadow: 0 0 12px rgba(0, 225, 255, 0.5);
}

.nav-dropdown-sep {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  margin: 2px 4px 4px;
}

/* En móvil el menú se muestra en flujo, no flotante */
@media (max-width: 768px) {
  .nav-dropdown-menu {
    position: static;
    margin-top: 4px;
    box-shadow: none;
    background-color: transparent;
    border: none;
    padding: 0 0 0 12px;
  }
}

/* En móvil, el navbar reducido de las páginas internas (explorar/detector/cursos)
   NO se colapsa (no tienen hamburguesa): se mantiene visible y en su lugar.
   Vence la regla .nav-buttons.show { display:none } de styles.css. */
@media (max-width: 768px) {
  .nav-buttons.nav-simple.show {
    display: flex !important;
    position: static;
    background: none;
    padding: 0;
    width: auto;
  }
}

/* Menú de cuenta del navbar (cuando hay sesión con nombre) */
.user-menu {
  position: relative;
  display: inline-block;
}

.user-menu-toggle {
  border: none;
  cursor: pointer;
}

.user-menu-list {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  min-width: 150px;
  background-color: rgba(13, 15, 17, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 6px;
  display: none;
  flex-direction: column;
  gap: 2px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  z-index: 1200;
}

.user-menu.open .user-menu-list {
  display: flex;
}

.user-menu-list a {
  color: #eee;
  text-decoration: none;
  font-weight: 500;
  padding: 10px 14px;
  border-radius: 8px;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.user-menu-list a:hover {
  background-color: rgba(0, 225, 255, 0.12);
  color: #00e1ff;
}

/* Hub "Explorar" (destino tras iniciar sesión) */
.explorar-page {
  min-height: 100vh;
  padding: 8rem 2rem 4rem;
  background-color: #0d0f11;
}

.explorar-container {
  max-width: 900px;
  margin: 0 auto;
}

.explorar-header {
  text-align: center;
  margin-bottom: 3rem;
}

.explorar-header h1 {
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  margin-bottom: 0.5rem;
  background: linear-gradient(90deg, #aaa, #fff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.explorar-header #explorarSubtitulo {
  color: #ccc;
  font-size: 0.95rem;
}

.explorar-header .detector-email {
  color: #00e1ff;
}

.explorar-bienvenida {
  margin: 1.5rem auto 0;
  max-width: 600px;
  color: #ddd;
  line-height: 1.7;
  background: rgba(0, 225, 255, 0.06);
  border: 1px solid rgba(0, 225, 255, 0.25);
  border-radius: 14px;
  padding: 1.25rem 1.5rem;
}

.explorar-seccion-titulo {
  font-size: 1.3rem;
  margin-bottom: 1.25rem;
  color: #fff;
}

.explorar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
}

.explorar-card {
  display: block;
  text-decoration: none;
  padding: 1.75rem;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.explorar-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 0 25px rgba(0, 225, 255, 0.2);
}

.explorar-card h3 {
  color: #fff;
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}

.explorar-card p {
  color: #ccc;
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: 1rem;
}

.explorar-badge {
  display: inline-block;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.7rem;
  letter-spacing: 0.5px;
  color: #00e1ff;
  border: 1px solid rgba(0, 225, 255, 0.4);
  border-radius: 20px;
  padding: 4px 12px;
}

/* Página del detector (área privada) */
.detector-page {
  min-height: 100vh;
  padding: 8rem 2rem 4rem;
  background-color: #0d0f11;
  display: flex;
  align-items: center;
  justify-content: center;
}

.detector-card {
  max-width: 600px;
  width: 100%;
  text-align: center;
}

.detector-card h1 {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  margin-bottom: 1rem;
}

.detector-card .detector-email {
  color: #00e1ff;
}

.detector-card p {
  color: #ccc;
  line-height: 1.7;
  margin-bottom: 2rem;
}

.detector-placeholder {
  border: 1px dashed rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  padding: 3rem 1.5rem;
  color: #777;
  font-size: 0.95rem;
  margin-bottom: 2rem;
}
