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

body::-webkit-scrollbar {
  width: 0.9em;
}

body::-webkit-scrollbar-track {
  background: #000;
}

body::-webkit-scrollbar-thumb {
  background-color: #fff;
  border-radius: 20px;
  border: 3px solid #000;
}

html {
  scroll-behavior: smooth;
  overflow: hidden;
}

body {
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  background-color: #0b0b0b;
  color: #fff;
}

.loader_bg {
  overflow: hidden;
}

/***************************************** loader *****************************************/
.loader_p {
  display: grid;
  place-items: center;
  width: 100vw;
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9999999;
  background-color: #000;
}

.loader {
  width: 80px;
  height: 50px;
  position: relative;
}

.loader-text {
  position: absolute;
  top: 0;
  color: #fff;
  animation: text_713 3.5s ease both infinite;
  font-size: .8rem;
  letter-spacing: 1px;
}

.load {
  background-color: #21183b;
  border-radius: 50px;
  display: block;
  height: 16px;
  width: 16px;
  bottom: 0;
  position: absolute;
  transform: translateX(64px);
  animation: loading_713 3.5s ease both infinite;
}

.load::before {
  position: absolute;
  content: "";
  width: 100%;
  height: 100%;
  background-color: #5c4d8a;
  border-radius: inherit;
  animation: loading2_713 3.5s ease both infinite;
}

@keyframes text_713 {
  0%, 100% { letter-spacing: 1px; transform: translateX(0px); }
  40% { letter-spacing: 2px; transform: translateX(26px); }
  80% { letter-spacing: 1px; transform: translateX(32px); }
  90% { letter-spacing: 2px; transform: translateX(0px); }
}

@keyframes loading_713 {
  0%, 100% { width: 16px; transform: translateX(0px); }
  40% { width: 100%; transform: translateX(0px); }
  80% { width: 16px; transform: translateX(64px); }
  90% { width: 100%; transform: translateX(0px); }
}

@keyframes loading2_713 {
  0%, 100% { transform: translateX(0px); width: 16px; }
  40% { transform: translateX(0%); width: 80%; }
  80% { width: 100%; transform: translateX(0px); }
  90% { width: 80%; transform: translateX(15px); }
}

body.loaded .loader_p {
  display: none;
}

/***************************************** layout *****************************************/
.contenedor {
  display: flex;
  height: 100vh;
  width: 100vw;
}

.lado-derecho {
  flex: 2; /* 2/3 of the space */
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  padding: 60px;
  order: 1;
}

.lado-izquierdo {
  flex: 1; /* 1/3 of the space */
  background-color: #0b0b0b;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 30px;
  order: 2;
  border-left: 1px solid rgba(255, 255, 255, 0.05);
  overflow-y: auto;
}

.lado-izquierdo::-webkit-scrollbar {
  width: 5px;
}

.lado-izquierdo::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}

.bg-video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}

.video-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  /* Gradient towards the form side (right) */
  background: linear-gradient(to right, rgba(0,0,0,0.2) 0%, rgba(0,0,0,0.9) 100%);
  z-index: 2;
}

.video-content {
  position: relative;
  z-index: 3;
  max-width: 600px;
}

.badge-privado {
  display: inline-block;
  background: rgba(30, 58, 138, 0.3);
  color: #3b82f6;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 24px;
  border: 1px solid rgba(59, 130, 246, 0.3);
  backdrop-filter: blur(4px);
}

.main-title {
  font-size: 4rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 20px;
  letter-spacing: -2px;
}

.main-subtitle {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.6;
  margin-bottom: 40px;
}

.stats-row {
  display: flex;
  gap: 40px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 30px;
}

.stat-item {
  display: flex;
  flex-direction: column;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
}

.stat-label {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.5);
  letter-spacing: 1px;
  margin-top: 4px;
}

.boton-volver {
  position: absolute;
  top: 40px;
  left: 40px;
  background: rgba(255, 255, 255, 0.05);
  padding: 10px 20px;
  border-radius: 12px;
  color: #fff;
  text-decoration: none;
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  font-weight: 500;
  transition: 0.3s;
  z-index: 10;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.boton-volver:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateX(-5px);
}

/***************************************** formulario *****************************************/
.formulario {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 20px 0;
}

.form-header {
  text-align: center;
}

.form-logo {
  width: 50px;
  height: 50px;
  object-fit: contain;
  margin-bottom: 20px;
}

.form-header h2 {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.form-header p {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.9rem;
}

.boton-google-moderno {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: #fff;
  color: #000;
  padding: 12px;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: 0.2s;
  position: relative;
}

.boton-google-moderno:hover {
  background: #f0f0f0;
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.divisor-moderno {
  text-align: center;
  position: relative;
  z-index: 1;
}

.divisor-moderno::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: 1px;
  background: rgba(255, 255, 255, 0.05);
  z-index: -1;
}

.divisor-moderno span {
  background: #0b0b0b;
  padding: 0 15px;
  color: rgba(255, 255, 255, 0.3);
  font-size: 0.75rem;
  text-transform: lowercase;
}

form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.input-doble {
  display: flex;
  gap: 12px;
}

.input-doble .input-group {
  flex: 1;
}

.input-group label {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.8rem;
  font-weight: 500;
  margin-left: 2px;
}

.input-moderno {
  position: relative;
  display: flex;
  align-items: center;
}

.input-moderno i {
  position: absolute;
  left: 16px;
  color: rgba(255, 255, 255, 0.2);
  font-size: 0.85rem;
}

.input-moderno input {
  width: 100%;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 12px 16px 12px 42px;
  border-radius: 10px;
  color: #fff;
  font-size: 0.9rem;
  transition: 0.2s;
}

/* Ajuste para inputs sin icono (nombres) */
.input-doble .input-moderno input {
    padding-left: 16px;
}

.input-moderno input:focus {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.2);
  outline: none;
}

.input-moderno span.fa-eye,
.input-moderno span.fa-eye-slash {
  position: absolute;
  right: 16px;
  color: rgba(255, 255, 255, 0.2);
  cursor: pointer;
  transition: 0.2s;
  z-index: 10;
  width: 32px; /* Fixed width to prevent jumping */
  display: flex;
  justify-content: center;
  align-items: center;
}

.input-moderno span.fa-eye:hover,
.input-moderno span.fa-eye-slash:hover {
  color: #fff;
}

.requisitos-modernos {
    list-style: none;
    padding: 10px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 10px;
    margin-bottom: 5px;
}

.requisitos-modernos li {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.error-text-small {
    color: #ef4444;
    font-size: 0.75rem;
    min-height: 18px;
}

.form-options {
  display: flex;
  align-items: center;
}

.container-checkbox {
  display: block;
  position: relative;
  padding-left: 24px;
  cursor: pointer;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.6);
  user-select: none;
}

.container-checkbox input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

.checkmark {
  position: absolute;
  top: 0;
  left: 0;
  height: 16px;
  width: 16px;
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

.container-checkbox input:checked ~ .checkmark {
  background-color: #3b82f6;
  border-color: #3b82f6;
}

.checkmark:after {
  content: "";
  position: absolute;
  display: none;
}

.container-checkbox input:checked ~ .checkmark:after {
  display: block;
}

.container-checkbox .checkmark:after {
  left: 5px;
  top: 2px;
  width: 4px;
  height: 8px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.link-tyc {
    color: #3b82f6;
    text-decoration: none;
    font-weight: 600;
}

.boton-acceder {
  background: #3b82f6;
  color: #fff;
  border: none;
  padding: 14px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  transition: 0.2s;
  box-shadow: 0 8px 16px rgba(59, 130, 246, 0.25);
}

.boton-acceder:hover {
  background: #2563eb;
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(59, 130, 246, 0.35);
}

.registro-link {
  text-align: center;
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.85rem;
}

.registro-link a {
  color: #3b82f6;
  text-decoration: none;
  font-weight: 600;
}

.form-footer {
  text-align: center;
  margin-top: 10px;
}

.form-footer p {
  color: rgba(255, 255, 255, 0.15);
  font-size: 0.75rem;
}

/***************************************** modales (glassmorphism) *****************************************/
.custom-alert-overlay,
#termsModalOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.custom-alert-overlay.show,
#termsModalOverlay.show {
    opacity: 1;
    visibility: visible;
}

.custom-alert-box,
#termsModalBox {
    background: rgba(20, 20, 20, 0.7);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 40px;
    border-radius: 24px;
    max-width: 450px;
    width: 90%;
    text-align: center;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    transform: scale(0.9);
    transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    color: #fff;
}

.custom-alert-overlay.show .custom-alert-box,
#termsModalOverlay.show #termsModalBox {
    transform: scale(1);
}

#termsModalBox {
    max-width: 800px;
    height: 80vh;
    display: flex;
    flex-direction: column;
    text-align: left;
}

#termsModalBody {
    flex: 1;
    overflow-y: auto;
    padding: 20px 0;
    margin: 20px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

#termsModalBody::-webkit-scrollbar {
    width: 6px;
}

#termsModalBody::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.custom-alert-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
}

.custom-alert-overlay.show {
    opacity: 1;
    visibility: visible;
}

.custom-alert-box {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(25px);
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 40px;
    color: #fff;
    text-align: center;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.6);
    transform: scale(0.9) translateY(20px);
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    max-width: 500px;
    width: 90%;
    position: relative;
}

.custom-alert-overlay.show .custom-alert-box {
    transform: scale(1) translateY(0);
}

.success-variant {
    border-color: rgba(16, 185, 129, 0.4);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
}

.error-variant {
    border-color: rgba(239, 68, 68, 0.4);
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
}

.alert-icon-container {
    font-size: 4rem;
    margin-bottom: 20px;
}

.success-variant .alert-icon-container { color: #10b981; }
.error-variant .alert-icon-container { color: #ef4444; }

.custom-alert-box h3 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.custom-alert-box p {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.5;
    margin-bottom: 30px;
}

.close-alert-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 1.8rem;
    color: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    line-height: 1;
    transition: 0.3s;
}

.close-alert-btn:hover {
    color: #fff;
    transform: rotate(90deg);
}

#custom-alert-ok-btn,
#acceptTermsBtn {
    background: #3b82f6;
    color: #fff;
    border: none;
    padding: 12px 35px;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.3s;
    margin-top: 10px;
}

#custom-alert-ok-btn:hover,
#acceptTermsBtn:hover {
    background: #2563eb;
    box-shadow: 0 10px 20px rgba(59, 130, 246, 0.3);
}

body.blur-active > *:not(.custom-alert-overlay):not(#termsModalOverlay):not(.error-message-overlay) {
    filter: blur(5px);
    transition: 0.3s;
}

/***************************************** responsive *****************************************/
@media (max-width: 1024px) {
  .contenedor {
    position: relative;
    display: block;
    overflow: hidden;
  }

  .lado-derecho {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    padding: 0;
    order: 0;
    z-index: 1;
  }

  /* Hide textual content over video on small screens */
  .video-content {
    display: none;
  }

  .lado-izquierdo {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.75); /* Darker overlay for form readability */
    z-index: 5;
    padding: 20px;
    border-left: none;
    order: 0;
    display: flex;
    justify-content: center;
    align-items: center;
  }

  .formulario {
    width: 90%;
    max-width: 400px;
    margin: auto;
  }

  /* Ensure fixed positioning for corners */
  .logo-mercy {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10;
  }

  #termsModalBox {
      height: 90vh;
  }

  .boton-volver {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 10;
  }
}