body[data-path="custom_login"] nav,
body[data-path="register"] nav,
body[data-path="custom_update_password"] nav {
  display: none;
}

#page-custom_login,
#page-custom_login .page-content-wrapper,
#page-custom_login .page-content-wrapper .container,
#page-custom_login .page-content-wrapper .container .page_content,
#page-custom_update_password,
#page-custom_update_password .page-content-wrapper,
#page-custom_update_password .page-content-wrapper .container,
#page-custom_update_password .page-content-wrapper .container .page_content {
  height: 100%;
  min-height: 100vh;
}

#page-custom_login .page-content-wrapper .container {
  max-width: 100%;
  padding: 0 !important;
  margin: 0 !important;
}

#page-custom_update_password .page-content-wrapper .container {
  max-width: 100%;
  padding: 0 !important;
  margin: 0 !important;
}

.custom-login-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.login-main-container {
  flex: 1;
  min-height: 100vh;
}

.for-login,
.for-forgot,
.for-signup,
.for-login-with-email-link,
.for-update-password {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

.for-forgot,
.for-signup,
.for-login-with-email-link,
.for-update-password {
  display: none;
}

.for-forgot[style*="display: block"],
.for-signup[style*="display: block"],
.for-login-with-email-link[style*="display: block"],
.for-update-password[style*="display: block"] {
  display: flex !important;
}

/* LEFT — Gradient Branding Panel */
.login-brand-panel {
  width: 45%;
  min-height: 100vh;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px;
  overflow: hidden;
}

.brand-rings {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.ring {
  position: absolute;
  border-radius: 50%;
}

.ring-1 {
  bottom: -60%;
  left: -30%;
  width: 160%;
  height: 160%;
  border: 40px solid rgba(255, 255, 255, 0.04);
}

.ring-2 {
  bottom: -40%;
  left: -20%;
  width: 130%;
  height: 130%;
  border: 30px solid rgba(255, 255, 255, 0.06);
}

.ring-3 {
  bottom: -20%;
  left: -10%;
  width: 100%;
  height: 100%;
  border: 25px solid rgba(255, 255, 255, 0.05);
}

.ring-4 {
  bottom: -5%;
  left: 5%;
  width: 70%;
  height: 70%;
  border: 20px solid rgba(255, 255, 255, 0.04);
}

.branding-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 16px;
  flex: 1;
  justify-content: center;
}

.brand-logo {
  width: 80px;
  height: 80px;
  object-fit: contain;
  display: none;
}

.brand-logo[src]:not([src=""]) {
  display: block;
}

.brand-name {
  font-size: 1.875rem;
  font-weight: 700;
  line-height: 2.25rem;
  color: #fff;
  margin: 0;
  letter-spacing: 0.5px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.brand-tagline {
  font-size: 15px;
  color: rgba(255, 255, 255, 0.85);
  margin: 0;
  font-weight: 400;
}

.brand-footer {
  position: relative;
  z-index: 1;
  text-align: center;
}

.brand-footer p {
  color: rgba(255, 255, 255, 0.5);
  font-size: 12px;
  margin: 0;
}

/* RIGHT — White Form Panel */
.login-form-panel {
  flex: 1;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 40px;
}

.login-form-inner {
  width: 100%;
  max-width: 580px;
}

.form-title {
  font-size: 26px;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0 0 6px 0;
}

.form-subtitle {
  font-size: 0.875rem;
  color: #6b7280;
  margin: 0 0 28px 0;
  font-weight: 400;
  line-height: 1.25rem;
}

.form-group {
  margin-bottom: 18px;
}

.field-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
  margin-bottom: 6px;
  line-height: 1.25rem;
}

.form-control {
  width: 100%;
  padding: 20px 10px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
  color: #1a1a1a;
  background: #fff;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
  box-sizing: border-box;
}

.form-control::placeholder {
  color: #9ca3af;
}

.form-control:focus {
  outline: none;
  border-color: #f97316;
}

.password-field {
  position: relative;
}

.password-field .form-control {
  padding-right: 44px;
}

.toggle-password {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #6b7280;
  cursor: pointer;
  display: flex;
  align-items: center;
  line-height: 1;
  transition: color 0.15s;
}

.toggle-password:hover {
  color: #f97316;
}

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

.remember-me {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #374151;
  cursor: pointer;
}

.remember-me input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: #f97316;
}

.forgot-link {
  font-size: 13px;
  color: #f97316;
  text-decoration: none;
  font-weight: 500;
}

.forgot-link:hover {
  text-decoration: underline;
}

.btn-login {
  width: 100%;
  padding: 0 28px;
  height: 44px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, #e05a40, #c0392b);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: white;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 14px rgba(192, 57, 43, 0.3);
}

.btn-login:hover {
  box-shadow: 0 6px 18px rgba(192, 57, 43, 0.4);
}

.btn-login:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

.btn-ldap {
  width: 100%;
  padding: 12px;
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  color: #374151;
  font-size: 14px;
  cursor: pointer;
  margin-top: 10px;
  transition: border-color 0.2s;
}

.btn-ldap:hover {
  border-color: #f97316;
}

.divider {
  display: flex;
  align-items: center;
  margin: 22px 0;
  color: #9ca3af;
  font-size: 13px;
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #e5e7eb;
}

.divider span {
  padding: 0 14px;
}

.social-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn-social:not([class*="btn-social-"]) {
  background: #fff;
  border-color: #d1d5db;
  color: #374151;
}

.signup-link {
  text-align: center;
  margin-top: 24px;
  font-size: 14px;
  color: #6b7280;
}

.signup-link a {
  color: #f97316;
  text-decoration: none;
  font-weight: 600;
}

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

.alert-danger {
  background: #fff1f0;
  border: 1px solid #fca5a5;
  border-radius: 8px;
  padding: 10px 14px;
  color: #b91c1c;
  font-size: 13px;
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  20%,
  60% {
    transform: translateX(-8px);
  }
  40%,
  80% {
    transform: translateX(8px);
  }
}

.invalid-login {
  animation: shake 0.4s ease;
}

.custom-login-page .page-card,
.custom-login-page .page-card-head,
.custom-login-page .page-card-body,
.custom-login-page .page-card-actions {
  all: unset;
  display: block;
}

@media (max-width: 900px) {
  .for-login,
  .for-forgot,
  .for-signup,
  .for-login-with-email-link {
    flex-direction: column;
  }

  .login-brand-panel {
    width: 100%;
    min-height: 220px;
    padding: 32px 24px;
  }

  .brand-rings {
    display: none;
  }

  .login-form-panel {
    padding: 40px 24px;
  }

  .login-form-inner {
    max-width: 100%;
  }
}

/* Register Page Overrides */
#page-register,
#page-register .page-content-wrapper,
#page-register .page-content-wrapper .container,
#page-register .page-content-wrapper .container .page_content {
  height: 100%;
  min-height: 100vh;
}

#page-register .page-content-wrapper .container {
  max-width: 100%;
  padding: 0 !important;
  margin: 0 !important;
}

@media (max-width: 600px) {
  .register-fields-grid {
    grid-template-columns: 1fr;
  }
}
