/* =========================
   RESET
========================= */
* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  margin: 0;
  padding: 0;
}

/* =========================
   BODY
========================= */
body {
  min-height: 100vh;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: #f8bbd0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px; 
  position: relative;
}

/* Evitar scroll en login */
body.auth-login {
  height: 100vh;
  overflow: hidden;
}

/* =========================
   AUTH HERO BACKGROUND
========================= */
.auth-page {
  background: #111;
  background-image: url("/assets/elitecupido-hero.jpg");
  background-size: cover;
  background-position: right center;
  background-repeat: no-repeat;
}

.auth-page::before {
  content: "";
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 20% 20%, rgba(0,0,0,0.12), rgba(0,0,0,0.45) 60%),
              linear-gradient(180deg, rgba(0,0,0,0.12), rgba(0,0,0,0.45));
  z-index: 0;
}

@media (max-width: 600px) {
  .auth-page {
    background-image: url("/assets/elitecupido-hero-mobile.jpg");
    
    background-position: center 110%;
    background-repeat: no-repeat;
    background-size: 110%;
  }

  body.auth-page {
    align-items: flex-start;
  }

  .auth-page .login-container {
    max-height: none;
    overflow: visible;
  }
}

.auth-page .login-container {
  position: relative;
  z-index: 1;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.5);
}

/* =========================
   CONTENEDOR
========================= */
.login-container {
  width: 100%;
  max-width: 400px;
  padding: 28px 24px;
  background: #ffffff;
  border-radius: 28px;
  box-shadow: 0 20px 40px rgba(233, 30, 99, 0.2), 0 10px 20px rgba(0,0,0,0.05);
  animation: fadeIn 0.45s ease;
  max-height: 95vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* Ocultar scrollbar opcional */
.login-container::-webkit-scrollbar {
  display: none;
}

/* =========================
   TITULO
========================= */
.login-container h1 {
  margin-bottom: 6px;
  font-size: 34px;
  text-align: center;
  color: #e91e63;
}
.greeting {
  margin: 0 0 4px 2px;
  text-align: left;
  font-size: 32px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #4a4a4a;
}

/* =========================
   SUBTITULO
========================= */
.subtitle {
  margin: 6px 0 16px;
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  color: #555;
}

/* =========================
   INPUTS / SELECT
========================= */
.login-container input,
.login-container textarea,
.login-container select {
  width: 100%;
  padding: 12px 16px;
  margin-bottom: 10px;
  font-size: 15px;
  border-radius: 20px;
  border: 1px solid #eee;
  background: #fafafa;
  outline: none;
  transition: all 0.3s ease;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.05);
}

/* =========================
   TELÉFONO CON LADA
========================= */
.phone-group {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.phone-group #dial-prefix {
  min-width: 54px;
  text-align: center;
  padding: 12px 10px;
  border-radius: 18px;
  background: #f1f1f1;
  border: 1px solid #eee;
  font-weight: 700;
  color: #444;
}

.phone-group input {
  margin-bottom: 0;
}

/* PLACEHOLDER */
.login-container input::placeholder,
.login-container textarea::placeholder {
  color: #aaa;
  font-size: 14px;
}

/* FOCUS */
.login-container input:focus,
.login-container textarea:focus,
.login-container select:focus {
  background: #fff;
  border-color: #e91e63;
  box-shadow: 0 0 0 3px rgba(233, 30, 99, 0.15);
}

/* INPUT ERROR (FORMULARIO) */
.input-error {
  border-color: #e53935 !important;
  background: #fff5f5;
}

/* =========================
   BOTÓN
========================= */
.login-container button {
  width: 100%;
  margin-top: 8px;
  padding: 14px;
  font-size: 16px;
  font-weight: 700;
  background: linear-gradient(135deg, #e91e63, #ff5a92);
  color: #fff;
  border: none;
  border-radius: 24px;
  cursor: pointer;
  box-shadow: 0 10px 25px rgba(233, 30, 99, 0.3);
  transition: all 0.3s ease;
}

.login-container button:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 14px 35px rgba(233, 30, 99, 0.35);
}

.login-container button:active {
  transform: scale(0.98);
}

.login-container button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* =========================
   TEXTO INFERIOR
========================= */
.login-container p {
  margin-top: 16px;
  text-align: center;
  font-size: 16px;
  color: #555;
}

.login-container a {
  color: #e91e63;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.2s;
}

.login-container a:hover {
  text-decoration: underline;
}

/* =========================
   TEXTO LEGAL
========================= */
.legal {
  font-size: 12px;
  color: #777;
  margin: 8px 0;
  text-align: center;
  line-height: 1.5;
}

.legal a {
  color: #e91e63;
}

/* =========================
   CHECKBOX TÉRMINOS
========================= */
.terms-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  line-height: 1.4;
  margin-bottom: 8px;
  flex-wrap: wrap; /* en móvil se ajusta */
}

.terms-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.terms-label span {
  flex: 1; /* ocupa el resto del espacio al lado del checkbox */
}

.terms-label a {
  color: #e91e63;
  text-decoration: underline;
}

/* =========================
   ERROR FORMULARIO (NO TOAST)
========================= */
.form-error,
.error {
  display: none;
  background: #ffe3e3;
  color: #c62828;
  border: 1px solid #ef9a9a;
  padding: 12px;
  border-radius: 14px;
  margin-bottom: 14px;
  font-size: 14px;
  text-align: center;
}

/* =========================
   MENSAJES TOAST
========================= */
.msg {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 18px 26px;
  border-radius: 22px;
  font-size: 16px;
  font-weight: 700;
  text-align: center;
  min-width: 260px;
  max-width: 90%;
  box-shadow: 0 20px 40px rgba(0,0,0,0.25);
  z-index: 99999;
  opacity: 1;
  animation: toastIn 0.35s ease;
}

/* ÉXITO */
.msg.toast-success {
  background: linear-gradient(135deg, #2ecc71, #27ae60);
  color: #ffffff;
}

/* ERROR */
.msg.toast-error {
  background: linear-gradient(135deg, #e74c3c, #c0392b);
  color: #ffffff;
}

/* INFO */
.msg.toast-info {
  background: linear-gradient(135deg, #3498db, #2980b9);
  color: #ffffff;
}

/* Animación */
@keyframes toastIn {
  from {
    opacity: 0;
    transform: translate(-50%, -60%) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

/* Verde */
.msg.success {
  background: linear-gradient(135deg, #2ecc71, #27ae60);
}

/* Rojo */
.msg.error {
  background: linear-gradient(135deg, #e74c3c, #c0392b);
}

.error-input {
  border: 2px solid red;
  background-color: #ffe6e6;
}

.success {
  display: none;
  background: #e0f8e9; 
  color: #2ecc71;      
  border: 1px solid #27ae60;
  padding: 12px;
  border-radius: 14px;
  margin-top: 10px;
  font-size: 14px;
  text-align: center;
}

/* =========================
   MODAL RECUPERACIÓN
========================= */
.modal {
  display: none; 
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0,0,0,0.5);
  padding-top: 60px;
}

.modal-content {
  background-color: #fff;
  margin: 5% auto;
  padding: 28px;
  border-radius: 20px;
  width: 90%;
  max-width: 400px;
  text-align: center;
  position: relative;
}

.modal-content h2 {
  margin-bottom: 12px;
  color: #e91e63;
}

.modal-content p {
  margin-bottom: 20px;
  color: #555;
}

.modal-content input {
  width: 100%;
  padding: 14px 18px;
  margin-bottom: 14px;
  border-radius: 20px;
  border: 1px solid #eee;
  background: #fafafa;
  outline: none;
  font-size: 15px;
}

.modal-content button {
  width: 100%;
  padding: 14px;
  font-size: 16px;
  font-weight: 700;
  background: linear-gradient(135deg, #e91e63, #ff5a92);
  color: #fff;
  border: none;
  border-radius: 24px;
  cursor: pointer;
  box-shadow: 0 10px 25px rgba(233, 30, 99, 0.3);
  transition: all 0.3s ease;
}

.modal-content button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.modal-content .close {
  position: absolute;
  top: 12px;
  right: 16px;
  font-size: 24px;
  font-weight: bold;
  color: #333;
  cursor: pointer;
}

.password-wrapper {
  position: relative;
  width: 100%;
}

.password-wrapper input {
  width: 100%;
  padding: 14px 44px 14px 18px;
}

#togglePassword {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  opacity: 0.7;
}

#togglePassword:hover {
  opacity: 1;
}
/* =========================
   BOTÓN VER CONTRASEÑA (FIX)
========================= */
.password-wrapper button {
  all: unset;                
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  color: #c2185b;
  opacity: 0.7;
}

.password-wrapper button:hover {
  opacity: 1;
}

.login-container > form > button {
  width: 100%;
}

.legal-intro,
.legal-section p,
.legal-section li {
  font-size: 15px;
  color: #333;
}

.legal-section p {
  margin-bottom: 14px;
}

.legal-section ul {
  margin: 12px 0 16px 20px;
}

.legal-section li {
  margin-bottom: 8px;
}

h1 {
  font-size: 26px;
  margin-bottom: 18px;
}

.legal-section h3 {
  font-size: 17px;
  margin-bottom: 8px;
  margin-top: 22px;
  color: #111;
}

.legal-section {
  padding-top: 10px;
  border-top: 1px solid #eee;
}

.legal-warning {
  background: #fff3cd;
  border-left: 4px solid #f0ad4e;
  padding: 12px 14px;
  margin: 12px 0;
  font-size: 14px;
}

/* =========================
   ANIMACIONES
========================= */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

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

/* =========================
   PANTALLAS BAJAS / CELULAR
========================= */
@media (max-width: 480px), (max-height: 700px) {
  .login-container {
    padding: 24px 20px;
  }

  .login-container h1 {
    font-size: 24px;
  }

  .login-container input,
  .login-container textarea,
  .login-container select {
    padding: 12px 14px;
    font-size: 14px;
  }

  .login-container button {
    padding: 14px;
  }

  .legal {
    font-size: 10.5px;
    margin: 6px 0;
  }

  .login-container p {
    font-size: 15px;
  }

  /* Ajuste de checkbox y términos en móvil */
  .terms-label {
    font-size: 13px;
    gap: 6px;
    margin-bottom: 6px;
  }

  .terms-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
  }
}

/* =========================
   FIX MÓVIL: INPUTS / PASSWORD
========================= */

/* Quitar highlight nativo al tocar */
input[type="checkbox"],
input[type="radio"] {
  -webkit-appearance: auto;
  appearance: auto;
}

/* Quitar fondo al seleccionar texto */
::selection {
  background: transparent;
  color: inherit;
}

::-moz-selection {
  background: transparent;
  color: inherit;
}

/* Fix específico iOS al cambiar password ↔ text */
input[type="password"],
input[type="text"] {
  background-clip: padding-box;
  -webkit-text-fill-color: #333;
}

/* Botón mostrar contraseña (👁️) */
.password-wrapper button {
  all: unset;
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  color: #c2185b;
  opacity: 0.7;
  background-color: transparent !important;
  box-shadow: none !important;
  outline: none !important;
}

/* Estado activo (cuando se presiona) */
.password-wrapper button:active {
  background-color: transparent !important;
  box-shadow: none !important;
  outline: none !important;
  opacity: 1;
}

/* Hover desktop */
.password-wrapper button:hover {
  opacity: 1;
}
