* {
  box-sizing: border-box;
  font-family: Arial, Helvetica, sans-serif;
}

body {
  margin: 0;
  height: 100vh;
  background: #111;
  display: flex;
  justify-content: center;
  align-items: center;
}

.container {
  background: #fff;
  border-radius: 12px;
  width: 900px;
  max-width: 100%;
  min-height: 500px;
  position: relative;
  overflow: hidden;
}

/* =======================
   FORMULARIOS
======================= */

.form-container {
  position: absolute;
  top: 0;
  height: 100%;
  width: 50%;
  padding: 60px 50px;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: all 0.6s ease-in-out;
}

.form-container form {
  width: 100%;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  text-align: center;
}

.form-container h2 {
  margin-bottom: 20px;
}

.form-container input {
  margin: 8px 0;
  padding: 12px;
  font-size: 13px;
}

.form-container button {
  margin-top: 15px;
  padding: 12px;
  border: none;
  background: #ff0057;
  color: white;
  font-size: 15px;
  cursor: pointer;
}

/* LOGIN */
.sign-in-container {
  left: 0;
  opacity: 1;
  z-index: 2;
}

/* REGISTRO */
.sign-up-container {
  opacity: 0;
  z-index: 1;
  pointer-events: none;
}


#registerForm input {
  border: #111 solid 1px;
}

/* =======================
   OVERLAY
======================= */

.overlay-container {
  position: absolute;
  top: 0;
  left: 50%;
  width: 50%;
  height: 100%;
  overflow: hidden;
  transition: transform 0.6s ease-in-out;
  z-index: 5;
}

.overlay {
  background: linear-gradient(to right, #ff0057, #8e2de2);
  color: #fff;
  position: relative;
  left: -100%;
  height: 100%;
  width: 200%;
  transform: translateX(0);
  transition: transform 0.6s ease-in-out;
}

.overlay-panel {
  position: absolute;
  width: 50%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 40px;
  text-align: center;
}

.overlay-panel h2 {
  margin-bottom: 10px;
}

.overlay-panel p {
  margin-bottom: 20px;
}

.overlay-left {
  transform: translateX(-20%);
}

.overlay-left {
  width: 100%;
  left: -4%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;

}

.overlay-right {
  right: 0;
}

.overlay-right h2,
.overlay-left h2 {
  font-size: 3.3rem;
}

.overlay-right p,
.overlay-left p {
  font-size: 2rem;
}

/* BOTONES OVERLAY */
button.ghost {
  background: rgb(226, 43, 174);
  border: 2px solid #fff;
  color: #fff;
  padding: 12px 30px;
  cursor: pointer;
}

/* =======================
   ESTADO ACTIVO
======================= */

.container.right-panel-active .sign-in-container {
  transform: translateX(100%);
  opacity: 0;
  pointer-events: none;
  z-index: 1;
}

.container.right-panel-active .sign-up-container {
  transform: translateX(100%);
  opacity: 1;
  z-index: 2;
  pointer-events: all;
}

.container.right-panel-active .overlay-container {
  transform: translateX(-100%);
}

.container.right-panel-active .overlay {
  transform: translateX(50%);
}

.error {
  color: #e63946;
  font-size: 0.85rem;
  min-height: 1em;
}

.input-error {
  border: 1px solid #e63946;
}

/* =====================
   PASSWORD TOGGLE
===================== */
.password-wrapper {
  position: relative;
}

.toggle-password {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  user-select: none;
}

/* =====================
   PASSWORD STRENGTH
===================== */
.password-strength {
  height: 6px;
  background: #ddd;
  border-radius: 4px;
  margin-top: 5px;
  overflow: hidden;
}

.strength-bar {
  height: 100%;
  width: 0%;
  background: red;
  transition: width 0.3s ease, background 0.3s ease;
}

/* =====================
   ERROR ANIMADO
===================== */
.error {
  color: #e63946;
  font-size: 0.85rem;
  min-height: 1em;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-3px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.mobile-home {
  display: none;
}

button,
.back-btn {
  border-radius: 3px;
}

/* =========================
   MOBILE MODE (SOLO MOVIL)
========================= */
@media (max-width: 768px) {

  body {
    background: black;
  }

  .container {
    width: 80%;
    min-height: 70vh;
    border-radius: 0;
    background: black;
  }

  h2 {
    color: white;
    font-family: poppins;
    font-size: 2rem;
  }

  /* Ocultamos overlay desktop */
  .overlay-container {
    display: none;
  }

  /* ======================
     HOME MOBILE
  ====================== */
  .mobile-home {
    position: absolute;
    inset: 0;

    /* Glassmorphism */
    background: rgba(69, 14, 57, 0.35);
    backdrop-filter: blur(14px) saturate(160%);
    -webkit-backdrop-filter: blur(14px) saturate(160%);
    border: 1px solid rgba(255, 0, 87, 0.35);
    box-shadow:
      0 0 25px rgba(255, 0, 87, 0.35),
      0 8px 32px rgba(0, 0, 0, 0.35);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 20px;
    z-index: 10;
    opacity: 1;
    transition: opacity 0.25s ease;
  }

  .mobile-home::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='0.08'/%3E%3C/svg%3E");
    opacity: 0.15;
    pointer-events: none;
    z-index: -1;
  }

  .mobile-home h2 {
    color: #fff;
    margin-bottom: 20px;
    font-family: poppins;
    font-size: 2.4rem;
  }

  .mobile-home button {
    width: 220px;
    padding: 14px;
    font-size: 16px;
    background: #ff0057;
    color: #fff;
    border: none;
    border-radius: 3px;
    cursor: pointer;
  }

  /* ======================
     FORMULARIOS MOBILE
  ====================== */
  .form-container {
    position: absolute;
    inset: 0;
    width: 100%;
    background: rgb(69, 14, 57);
    border-radius: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
  }

  .form-container.mobile-active {
    opacity: 1;
    pointer-events: all;
    z-index: 20;
  }

  /* Botón volver */
  .back-btn {
    background: none;
    border: none;
    color: #555;
    margin-bottom: 15px;
    cursor: pointer;
    font-size: 14px;
    align-self: flex-start;
  }

  /* Neutralizamos desktop */
  .sign-in-container,
  .sign-up-container {
    left: 0 !important;
    transform: none !important;
  }

  .toggle-password {
    font-size: 2rem;
  }
}