* {
  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-x: 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: 40px;
  order: 2;
  border-left: 1px solid rgba(255, 255, 255, 0.05);
}

.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%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

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

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

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

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

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

.boton-google-moderno i {
  position: absolute;
  right: 20px;
  font-size: 0.8rem;
  opacity: 0.5;
}

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

.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.8rem;
  text-transform: lowercase;
}

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

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

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

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

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

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

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

.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.3s;
  padding: 10px;
  width: 40px; /* Fixed width to prevent jumping */
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 5;
}

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

.form-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.container-checkbox {
  display: block;
  position: relative;
  padding-left: 28px;
  cursor: pointer;
  font-size: 0.85rem;
  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: 18px;
  width: 18px;
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

.container-checkbox:hover input ~ .checkmark {
  background-color: rgba(255, 255, 255, 0.1);
}

.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: 6px;
  top: 2px;
  width: 5px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

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

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

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

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

.registro-link a:hover {
  text-decoration: underline;
}

.form-footer {
  margin-top: auto;
  text-align: center;
  padding-top: 20px;
}

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

/***************************************** errores y alertas *****************************************/
.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;
  letter-spacing: -0.5px;
}

.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 {
  background: #3b82f6;
  color: #fff;
  border: none;
  padding: 14px 40px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: 0.3s;
  box-shadow: 0 10px 20px rgba(59, 130, 246, 0.3);
}

#custom-alert-ok-btn:hover {
  background: #2563eb;
  transform: translateY(-2px);
  box-shadow: 0 15px 30px rgba(59, 130, 246, 0.4);
}

body.blur-active > *:not(.custom-alert-overlay) {
  filter: blur(10px);
  transition: 0.5s;
}

/***************************************** 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;
  }

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

  .logo-mercy {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10;
  }

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