/* =======================================================
 * YPSA LOGIN SLIDING CURTAIN BOX - MASTER STYLESHEET
 * ======================================================= */
@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap");

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

body {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background-color: #e9efff;
  padding: 1.25rem;
  font-family: "Poppins", sans-serif;
  font-size: 1rem;
}

.auth-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.container {
  position: relative;
  width: 53.125rem; /* 850px */
  max-width: 100%;
  height: 34.375rem; /* 550px */
  background: #fff;
  border-radius: 1.875rem; /* 30px */
  box-shadow: 0 0.625rem 2.5rem rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

/* --- OVERLAY PANEL (BIRU YPSA PERIWINKLE) --- */
.overlay-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 50%;
  height: 100%;
  background-color: #7a97e5;
  z-index: 100;
  display: flex;
  justify-content: center;
  align-items: center;
  color: #fff;
  overflow: hidden;
  transition: all 0.7s cubic-bezier(0.6, -0.28, 0.735, 0.045);
}

.container .overlay-container {
  animation: shrink-h 0.7s forwards;
}

.container.active .overlay-container {
  animation: expand-h 0.7s forwards;
}

@keyframes expand-h {
  0% {
    width: 50%;
    left: 0;
    border-radius: 0 9.375rem 9.375rem 0;
  }
  50% {
    width: 100%;
    left: 0;
    border-radius: 0;
  }
  100% {
    width: 50%;
    left: 50%;
    border-radius: 9.375rem 0 0 9.375rem;
  }
}

@keyframes shrink-h {
  0% {
    width: 50%;
    left: 50%;
    border-radius: 9.375rem 0 0 9.375rem;
  }
  50% {
    width: 100%;
    left: 0;
    border-radius: 0;
  }
  100% {
    width: 50%;
    left: 0;
    border-radius: 0 9.375rem 9.375rem 0;
  }
}

/* --- FORM BOXES --- */
.form-box {
  position: absolute;
  top: 0;
  width: 50%;
  height: 100%;
  padding: 2.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  transition: all 0.7s cubic-bezier(0.6, -0.28, 0.735, 0.045);
}

.login-box {
  right: 0;
  transform: translateX(0);
  opacity: 1;
}

.register-box {
  left: 0;
  transform: translateX(100%);
  opacity: 0;
  pointer-events: none;
}

.container.active .login-box {
  transform: translateX(-100%);
  opacity: 0;
  pointer-events: none;
}

.container.active .register-box {
  transform: translateX(0);
  opacity: 1;
  pointer-events: all;
}

/* --- UI ELEMENTS & TYPOGRAPHY --- */
.overlay-content {
  text-align: center;
  padding: 1.5rem;
}

.overlay-content h1 {
  font-size: 2.2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: #ffffff;
}

.overlay-content p {
  font-size: 0.95rem;
  opacity: 0.92;
  margin-bottom: 0.5rem;
}

h2 {
  margin-bottom: 1.25rem;
  font-size: 1.65rem;
  font-weight: 600;
  color: #1e293b;
}

.desc {
  text-align: center;
  margin-bottom: 1.25rem;
  color: #64748b;
  font-size: 0.85rem;
  line-height: 1.5;
}

.logo-container {
  margin-bottom: 1.25rem;
  display: flex;
  justify-content: center;
}

.logo {
  max-width: 14rem;
  height: auto;
  object-fit: contain;
}

.input-group {
  width: 100%;
  position: relative;
  margin-bottom: 1.1rem;
}

.input-group input {
  width: 100%;
  padding: 0.8rem 2.6rem 0.8rem 1rem;
  background: #f1f5f9;
  border: 1px solid transparent;
  border-radius: 0.625rem;
  outline: none;
  font-size: 0.92rem;
  font-family: inherit;
  transition: border-color 0.2s, background-color 0.2s;
}

.input-group input:focus {
  background: #ffffff;
  border-color: #7a97e5;
  box-shadow: 0 0 0 3px rgba(122, 151, 229, 0.15);
}

.input-group i {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: 1.25rem;
}

.input-group i.password-toggle {
  cursor: pointer;
  user-select: none;
  transition: color 0.2s ease, transform 0.15s ease;
}

.input-group i.password-toggle:hover {
  color: #475569;
  transform: translateY(-50%) scale(1.1);
}

.btn-main {
  width: 100%;
  padding: 0.85rem;
  background: #7a97e5;
  color: #fff;
  border: none;
  border-radius: 0.625rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s, transform 0.1s;
  font-size: 0.95rem;
  font-family: inherit;
}

.btn-main:hover:not(:disabled) {
  background: #627ec7;
}

.btn-main:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.btn-outline {
  padding: 0.55rem 1.75rem;
  border: 0.125rem solid #fff;
  background: transparent;
  color: #fff;
  border-radius: 0.625rem;
  cursor: pointer;
  margin-top: 1.2rem;
  transition: background 0.3s, color 0.3s;
  font-size: 0.92rem;
  font-family: inherit;
  font-weight: 500;
}

.btn-outline:hover {
  background: #fff;
  color: #7a97e5;
}

/* Alert Notification Boxes */
.alert-error {
  width: 100%;
  background-color: #ffe5e5;
  color: #d8000c;
  padding: 0.75rem;
  border-radius: 0.625rem;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-size: 0.84rem;
  border: 1px solid #ffbaba;
  animation: fadeIn 0.3s ease-in-out;
}

.alert-success {
  width: 100%;
  background-color: #e6f9ed;
  color: #155724;
  padding: 0.75rem;
  border-radius: 0.625rem;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-size: 0.84rem;
  border: 1px solid #c3e6cb;
  animation: fadeIn 0.3s ease-in-out;
}

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

/* --- RESPONSIVE MOBILE BREAKPOINT (<= 768px) --- */
@media (max-width: 768px) {
  .container {
    width: 100%;
    max-width: 25rem; /* 400px */
    height: 40.625rem; /* 650px */
  }

  .overlay-container {
    width: 100%;
    height: 40%;
  }

  .form-box {
    width: 100%;
    height: 60%;
    top: 40%;
    left: 0;
    padding: 1.5rem;
  }

  .overlay-content h1 {
    font-size: 1.7rem;
  }

  .container .overlay-container {
    animation: shrink-v 0.7s forwards;
  }

  .container.active .overlay-container {
    animation: expand-v 0.7s forwards;
  }

  @keyframes expand-v {
    0% {
      height: 40%;
      top: 0;
      border-radius: 0 0 6.25rem 6.25rem;
    }
    50% {
      height: 100%;
      top: 0;
      border-radius: 0;
    }
    100% {
      height: 40%;
      top: 60%;
      border-radius: 6.25rem 6.25rem 0 0;
    }
  }

  @keyframes shrink-v {
    0% {
      height: 40%;
      top: 60%;
      border-radius: 6.25rem 6.25rem 0 0;
    }
    50% {
      height: 100%;
      top: 0;
      border-radius: 0;
    }
    100% {
      height: 40%;
      top: 0;
      border-radius: 0 0 6.25rem 6.25rem;
    }
  }

  .login-box {
    transform: translateY(0);
  }

  .register-box {
    transform: translateY(100%);
  }

  .container.active .login-box {
    transform: translateY(-100%);
  }

  .container.active .register-box {
    transform: translateY(0);
  }
}
