﻿/* =============================
   ESTILOS GENERALES
============================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Montserrat", sans-serif;
}

body.login {
  background: linear-gradient(135deg, #e039c2, #b72bc4);
}

/* =============================
   BOTÃ“N SUPERIOR CORONA
============================= */
.top-home {
  position: fixed;
  top: 4vh;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.home-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 0;
}

.back-text {
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.3px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  background: #d92e82;
  border: none;
  border-radius: 999px;
  padding: 4px 9px;
  line-height: 1;
  display: inline-block;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.28) inset;
  margin-left: 4px;
}

.home-btn img {
  width: 100px;
  height: 100px;
  background: transparent;
  border-radius: 0;
  filter: drop-shadow(0 5px 12px rgba(255, 62, 129, 0.4));
  transition: transform 0.4s ease;
}

.home-btn:hover img {
  transform: scale(1.08);
  filter: drop-shadow(0 6px 16px rgba(255, 62, 129, 0.8));
}

.home-btn:hover .back-text {
  filter: brightness(1.05);
}

/* =============================
   FORMULARIO PRINCIPAL
============================= */
.container {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 25px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
  width: clamp(320px, 90%, 380px);
  text-align: center;
  padding: 40px 30px;
  margin: 0 auto;
  margin-top: 0; /* que no empuje la corona */
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.3s ease;
}

.logo {
  width: 160px;
  margin-bottom: 20px;
}

h2 {
  margin-bottom: 10px;
  font-weight: 700;
}
body.register h2 {
  color: #ff3e81;
}
body.login h2 {
  color: #a12bb5;
}

p.sub {
  color: #444;
  font-size: 14px;
  margin-bottom: 15px;
}

input {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 12px;
  margin: 10px 0;
  font-size: 15px;
  background: #f3f3f3;
}
body.login .container input.input-error {
  border: 2px solid #ff3e81;
  background: #ffe5ef;
  box-shadow: 0 0 8px rgba(255, 62, 129, 0.35);
}
body.login .container input.input-shake {
  animation: login-shake 0.25s ease;
}
@keyframes login-shake {
  0% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-4px);
  }
  50% {
    transform: translateX(4px);
  }
  75% {
    transform: translateX(-3px);
  }
  100% {
    transform: translateX(0);
  }
}

/* =============================
   CHECKBOX + TÃ‰RMINOS
============================= */
label.terms {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #444;
  text-align: left;
  line-height: 1.4;
  margin-top: 8px;
  margin-bottom: 14px;
  white-space: normal;
  flex-wrap: nowrap;
  width: 100%;
}

label.terms input[type="checkbox"] {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: #ff3e81;
  cursor: pointer;
}

label.terms span {
  display: inline;
  word-break: break-word;
}

body.register label.terms a {
  color: #ff3e81;
  text-decoration: none;
  font-weight: 600;
}

body.login label.terms a {
  color: #a12bb5;
  text-decoration: none;
  font-weight: 600;
}

/* =============================
   BOTONES
============================= */
button {
  border: none;
  color: white;
  padding: 12px 20px;
  border-radius: 20px;
  font-weight: bold;
  cursor: pointer;
  width: 100%;
  font-size: 16px;
  transition: transform 0.2s ease;
}

body.login .container button {
  background: linear-gradient(90deg, #c22da8, #a12bb5);
}

/* Evita que el botÃ³n superior (corona) tenga fondo */
.home-btn {
  background: transparent !important;
  box-shadow: none !important;
}

button:hover {
  transform: scale(1.05);
}

/* =============================
   BOTÃ“N GOOGLE
============================= */
.google-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 2px solid #ddd;
  border-radius: 20px;
  background: white;
  color: #333;
  font-weight: 500;
  padding: 12px;
  width: 100%;
  margin-top: 15px;
  cursor: pointer;
  transition: all 0.3s ease;
}
.google-btn img {
  width: 22px;
  height: 22px;
}
.google-btn:hover {
  background: #f3f3f3;
}

/* =============================
   ENLACES INFERIORES
============================= */
p.msg {
  color: #555;
  font-size: 14px;
  text-align: center;
  margin-top: 8px;
}

p.msg a {
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s ease;
}

body.register p.msg a {
  color: #ff3e81;
}
body.login p.msg a {
  color: #a12bb5;
}

p.msg a:hover {
  opacity: 0.85;
}

/* =============================
   RESPONSIVE
============================= */
@media (max-width: 600px) {
  .container {
    width: 85%;
    padding: 30px 25px;
    min-height: auto;
    margin-top: 120px;
  }
  @media (max-width: 768px) {
    .container {
      width: 90%;
      padding: 30px 24px;
    }
    .home-btn img {
      width: 90px;
    }
  }

  @media (max-height: 700px) {
    body.login,
    body.register {
      padding-top: 120px; /* ajusta en pantallas bajas */
    }
  }

  .home-btn img {
    width: 80px;
    height: 80px;
  }
}

.verify-hint {
  font-size: 13px;
  color: #666;
  margin-top: 8px;
}

/* ===== Modal TyC ===== */
.modal {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(140% 120% at 0% 0%, rgba(255, 107, 168, 0.16), rgba(38, 0, 70, 0.85)),
    rgba(7, 0, 18, 0.76);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(10px);
  z-index: 9999;
}

.modal-content {
  position: relative;
  background: linear-gradient(160deg, #130020 0%, #0f001a 40%, #0a0016 100%);
  color: #f5f0ff;
  padding: 32px 28px 24px;
  border-radius: 28px;
  width: min(460px, 92vw);
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow:
    0 28px 90px rgba(8, 0, 25, 0.7),
    0 0 0 1px rgba(255, 255, 255, 0.05) inset;
  overflow: hidden;
}

.terms-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% -10%, rgba(255, 82, 177, 0.2), transparent 50%);
  pointer-events: none;
}

.terms-top {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 0;
}

.terms-title {
  margin: 6px 0 10px;
  color: #ff4fa3;
  font-size: 1.28rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  text-shadow: 0 3px 12px rgba(255, 79, 163, 0.3);
}

.terms-copy {
  color: #e8ddff;
  font-size: 0.98rem;
  line-height: 1.55;
  margin: 6px 0 14px;
}

.terms-copy a {
  color: #ff4fa3;
  font-weight: 700;
  text-decoration: none;
  border-bottom: none;
  transition: color 0.2s ease;
}

.terms-copy a:hover {
  color: #ff9ad0;
}

.terms-highlights {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 18px;
}

.terms-highlights span {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #f4edff;
  font-size: 12px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.modal-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 10px;
}

.btn-accept {
  flex: 0 1 180px;
  background: linear-gradient(100deg, #ff5f9f, #ff8c3b);
  color: #fff;
  border: none;
  padding: 12px 18px;
  border-radius: 14px;
  cursor: pointer;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  box-shadow: 0 14px 30px rgba(255, 62, 129, 0.35);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.btn-accept:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 36px rgba(255, 62, 129, 0.48);
}

.btn-cancel {
  flex: 0 1 150px;
  background: rgba(255, 255, 255, 0.08);
  color: #f4edff;
  border: 1px solid rgba(255, 255, 255, 0.22);
  padding: 12px 18px;
  border-radius: 14px;
  cursor: pointer;
  font-weight: 700;
  transition: background 0.18s ease, border-color 0.18s ease;
}

.btn-cancel:hover {
  background: rgba(255, 255, 255, 0.13);
  border-color: rgba(255, 255, 255, 0.36);
}

.terms-actions {
  width: 100%;
}

@media (max-width: 520px) {
  .modal {
    padding: 14px;
  }
  .modal-content {
    padding: 26px 20px 20px;
  }
  .modal-actions {
    flex-direction: column;
  }
  .terms-badge {
    font-size: 11px;
  }
}

/* ðŸ”¹ Enlace de 'Â¿Olvidaste tu contraseÃ±a?' */
.forgot {
  margin-top: 10px;
  text-align: center;
}

.forgot a {
  font-weight: 600;
  font-size: 0.9rem;
  background: linear-gradient(90deg, #ff5f6d, #f8be6c);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-decoration: none !important;
  text-decoration-color: transparent !important;
  text-decoration-thickness: 0 !important;
  border-bottom: 0 !important;
  transition: all 0.3s ease;
  letter-spacing: 0.3px;
}

.forgot a:link,
.forgot a:visited,
.forgot a:hover,
.forgot a:focus,
.forgot a:active {
  text-decoration: none !important;
  text-decoration-color: transparent !important;
  border-bottom: 0 !important;
}

.forgot a:hover,
.forgot a:focus {
  opacity: 0.9;
  filter: brightness(1.1);
}

/* =============================
   FIX SCROLL Y ALTURA PERFECTA
============================= */
html {
  height: 100%;
  scroll-behavior: smooth;
}

body.login,
body.register {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  overflow-y: auto; /* âœ… permite scroll solo cuando se necesita */
  padding-top: 160px; /* ðŸ”¹ espacio fijo para la corona */
  padding-bottom: 100px; /* espacio antes del footer */
}

/* ðŸ”¹ Evita que la corona se mueva */
.top-home {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
}

/* ðŸ”¹ Ajusta el contenedor para que nunca se corte */
.container {
  margin-top: 60px;
  margin-bottom: 80px;
}

/* ðŸ”¹ En pantallas muy pequeÃ±as */
@media (max-height: 700px) {
  body {
    padding-top: 140px;
  }
}
/* ======== FIX FINAL: centrado + scroll + footer correcto ======== */

html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
}

/* Mantiene scroll y altura completa */
body.login,
body.register {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  overflow-y: auto;
}

/* Centra el formulario verticalmente, pero deja espacio al footer */
.container {
  margin: auto 0; /* centra verticalmente */
  padding-top: 140px; /* deja espacio para la corona fija */
  padding-bottom: 100px; /* deja espacio antes del footer */
}

/* Footer normal, despuÃ©s del contenido */
.catabum-footer {
  margin-top: auto;
  border: none;
  flex-shrink: 0;
}

/* =============================
   LOGIN: estilos alineados a register
   (colores, espaciados y footer sin hueco)
   Estas reglas finales tienen precedencia.
============================= */
body.login {
  /* Igual que register */
  background: linear-gradient(90deg, #40026d, #9c11a8);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: 60px;
  padding-bottom: 0; /* evita hueco bajo el footer */
}

.top-home {
  position: relative; /* no fijar para no forzar paddings extra */
  left: auto;
  top: auto;
  transform: none;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-bottom: 25px;
}

.home-btn img {
  width: 100px;
  height: auto;
  filter: drop-shadow(0 5px 12px rgba(255, 62, 129, 0.5));
  transition: transform 0.3s ease;
}
.home-btn:hover img {
  transform: scale(1.08);
}

.container {
  background: rgba(255, 255, 255, 0.96);
  border-radius: 25px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
  width: clamp(320px, 90%, 400px);
  text-align: center;
  padding: 35px 28px;
  margin: 0 auto 24px; /* deja aire sin empujar el footer */
  display: flex;
  flex-direction: column;
  gap: 12px;
  /* No crecer verticalmente: evita tarjeta "larga" en mÃ³vil */
  flex: 0 0 auto;
}

.logo {
  width: 160px;
  margin-bottom: 15px;
}
h2 {
  color: #ff3e81;
  margin-bottom: 10px;
  font-weight: 700;
}
p.sub {
  color: #444;
  font-size: 14px;
  margin-bottom: 15px;
}
input {
  width: 100%;
  padding: 11px;
  border: none;
  border-radius: 12px;
  margin: 8px 0;
  font-size: 15px;
  background: #f7f7f7;
}

button {
  border: none;
  color: #fff;
  padding: 12px 20px;
  border-radius: 20px;
  font-weight: 700;
  width: 100%;
  font-size: 16px;
  background: linear-gradient(90deg, #ff3e81, #ff8c3b);
  transition: transform 0.2s ease;
}
button:hover {
  transform: scale(1.05);
}

.google-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 2px solid #ddd;
  border-radius: 20px;
  background: #fff;
  color: #333;
  font-weight: 500;
  padding: 12px;
  margin-top: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
}
.google-btn img {
  width: 22px;
  height: 22px;
}
.google-btn:hover {
  background: #f3f3f3;
}

p.msg {
  color: #555;
  font-size: 14px;
  text-align: center;
  margin-top: 5px;
}
p.msg a {
  color: #ff3e81;
  text-decoration: none;
  font-weight: 600;
}

.catabum-footer {
  width: 100%;
  background: transparent !important; /* hereda el degradado del body sin cortes */
  color: #fff;
  text-align: center;
  padding: 20px 10px;
  box-shadow: 0 -3px 10px rgba(0, 0, 0, 0.2);
  border: none;
  margin-top: auto; /* empuja al fondo dentro del body flex */
  position: relative;
}
.catabum-footer p,
.catabum-footer a {
  color: #fff;
  font-size: 13px;
  text-decoration: none;
  margin: 0 5px;
}
.catabum-footer a:hover {
  text-decoration: underline;
}

@media (max-width: 768px) {
  .container {
    width: 88%;
    padding: 30px 22px;
  }
  .home-btn img {
    width: 80px;
  }
  body.login {
    padding-top: 40px;
    padding-bottom: 0;
  }
}

/* Mobile-first fix (aplica al final):
   La tarjeta se adapta al contenido y encaja en la pantalla */
@media (max-width: 600px) {
  .container {
    width: 90%;
    padding: 24px 20px;
    margin: 16px auto 24px;
    flex: 0 0 auto; /* nunca llenar toda la altura */
  }
  body.login {
    padding-top: 16px;
  }
  .home-btn img {
    width: 80px;
    height: auto;
  }
}

/* ===== Sticky footer sin huecos (reglas finales con prioridad) ===== */
html,
body {
  height: 100%;
}
/* Color de fondo base para las zonas blancas del navegador en mÃ³vil */
html {
  background-color: #4d056e;
}
body.login {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-bottom: 0 !important; /* nunca reservar hueco inferior */
}
.container {
  /* SeparaciÃ³n fija del footer en todos los tamaÃ±os */
  margin-bottom: clamp(24px, 4vh, 48px) !important;
}
.catabum-footer {
  margin-top: auto !important; /* pegado al fondo */
  border-top: 0 !important; /* sin lÃ­nea separadora */
}
/* ====== Fix corte/espacios blancos en móvil (iOS/Android) ====== */
body.login {
  background: none !important; /* el gradiente lo pinta la capa fija */
  position: relative !important;
}
body.login::before {
  content: "";
  position: fixed;
  inset: 0; /* top/right/bottom/left: 0 */
  z-index: -1; /* detrás de todo el contenido */
  background: linear-gradient(90deg, #40026d, #9c11a8);
}
/* Footer conserva sombra/divisor pero sin fondo propio para no cortar */
body.login .catabum-footer {
  background: transparent !important;
  box-shadow: 0 -3px 10px rgba(0, 0, 0, 0.2) !important;
  border-top: 1px solid rgba(255, 255, 255, 0.12) !important;
}
