/* Clean compact Login Page Styles */
* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  overflow-y: auto;
}
body {
  margin: 0;
  font-family: "Poppins", "Segoe UI", Roboto, Arial, sans-serif;
  background: #fff;
  color: #0d1b3e;
  -webkit-font-smoothing: antialiased;
}

:root {
  --card-width: 250px; /* form width */
  --side-panel-max: 340px; /* max width of right panel */
  --side-panel-min: 280px; /* min width */
}

.auth-wrapper {
  position: relative;
  min-height: 100vh;
  width: 100%;
  overflow: hidden;
  display: block; /* no flex base layout needed now */
}

/* Visual background now spans entire viewport */
.visual-panel {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 0;
}
.visual-panel .bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  animation: crossfade 16s infinite;
}
.visual-panel .bg.bg1 {
  background-image: url("../images/background_2.jpg");
  animation-delay: 0s;
}
.visual-panel .bg.bg2 {
  background-image: url("../images/background_1.jpg");
  animation-delay: 8s;
}
.visual-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.45) 0%, rgba(0, 0, 0, 0.18) 40%, rgba(0, 0, 0, 0) 70%);
  pointer-events: none;
}
@keyframes crossfade {
  0%,
  40% {
    opacity: 1;
  }
  50%,
  90% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

/* Side panel (form + text) */
.side-panel {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100vh;
  display: flex;
  justify-content: flex-end; /* push card to right edge */
  align-items: center; /* vertical center */
  padding: 2.2rem 2.8rem;
  pointer-events: none; /* allow only card interactions */
}

/* remove custom scrollbars since panel not scrollable now */
.auth-card .d-flex {
  margin-top: -0.2rem; /* Reduce space above the two logos */
}
.brand-logo1 {
  width: 200px;
  height: 200px;
  object-fit: contain;
  display: block;
  margin: 0 auto 0;
}
.brand-logo2,
.brand-logo3 {
  width: 150px;
  height: 100px;
  object-fit: contain;
  display: block;
  margin: 0;
  flex: 0 0 220px;
  max-width: none;
  margin-bottom: 2rem;
}

/* Auth (login) card */
.auth-card {
  width: 100%;
  max-width: 500px;
  padding: 1.8rem 2rem 1.4rem;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 2px solid rgba(255, 255, 255, 0.6);
  border-radius: 26px; /* rounded corners */
  position: relative;
  box-shadow: 0 10px 34px -10px rgba(0, 0, 0, 0.45);
  transition: border-color 0.3s, box-shadow 0.3s, background 0.3s;
  pointer-events: auto; /* re-enable interactions inside */
}
.auth-card img {
  max-width: 100%;
  height: auto;
}
.auth-card.single {
  padding-top: 0.75rem;
}
.auth-card label {
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.2px;
}
.auth-card .form-control {
  height: 44px;
  padding: 0.55rem 0.8rem;
  font-size: 0.8rem;
}
.input-group .btn {
  font-size: 0.65rem;
  padding: 0.25rem 0.5rem;
}

/* Password toggle alignment */
.password-group {
  position: relative;
}
.password-with-toggle {
  padding-right: 40px; /* space for eye button */
}
.toggle-password-btn {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #516078;
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.2s, color 0.2s;
}
.toggle-password-btn:hover {
  background: rgba(0, 0, 0, 0.05);
}
.toggle-password-btn:focus {
  outline: 2px solid #0d6efd55;
  outline-offset: 2px;
}

/* Smaller Login button */
.login-btn {
  display: block;
  line-height: 1.1;
  border-radius: 6px;
  margin: 4px auto 0;
  font-weight: 500;
  letter-spacing: 0.3px;
  width: 140px;
  font-size: 0.75rem;
  padding: 0.45rem 0.9rem;
}

/* Animated border effect on submit */
.auth-card.animated-border {
  --angle: 0deg;
  border: 3px solid transparent;
  background: linear-gradient(#fff, #fff) padding-box, conic-gradient(from var(--angle), #ff4545, #00ff99, #006aff, #ff0095, #ff4545) border-box;
  animation: spin 2.5s linear infinite;
  box-shadow: 0 0 12px -2px rgba(0, 0, 0, 0.15), 0 0 18px -4px rgba(0, 128, 255, 0.35);
}
@property --angle {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}
@keyframes spin {
  from {
    --angle: 0deg;
  }
  to {
    --angle: 360deg;
  }
}
.auth-card.animating {
  will-change: filter, transform;
}

/* Floating outlined field */
.outlined-field {
  position: relative;
}
.outlined-field .outlined-control {
  height: 38px;
  padding: 0.35rem 0.6rem;
  font-size: 0.82rem;
  border: 1px solid #b9c0d0;
  border-radius: 8px;
  background: transparent;
  box-shadow: none;
}
.outlined-field .outlined-control:focus {
  border-color: #0d6efd;
  box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.15);
  background: #fff;
}

/* Label sits on the border, animates up on focus or when filled */
.floating-label {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  padding: 0 6px;
  font-size: 0.78rem;
  color: #516078;
  background: var(--card-bg, rgba(255, 255, 255, 0));
  pointer-events: none;
  transition: transform 0.16s ease, color 0.16s ease, top 0.16s ease, font-size 0.16s ease;
}

/* Use placeholder-shown to detect empty state */
.outlined-field .outlined-control::placeholder {
  color: transparent;
}

/* Float state */
.outlined-field .outlined-control:focus + .floating-label,
.outlined-field .outlined-control:not(:placeholder-shown) + .floating-label {
  top: 0;
  transform: translateY(-50%) scale(0.9);
  color: #0d6efd;
  background: var(--card-bg, rgba(255, 255, 255, 0.822));
  border-radius: 5px;
}

/* Password toggle aligned for compact height */
.password-with-toggle {
  padding-right: 38px;
}
.toggle-password-btn {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border: 0;
  background: transparent;
  color: #516078;
}
@media (min-width: 0px) and (max-width: 599px) {
  /* Extra-small phones */
  .side-panel {
    justify-content: center;
    align-items: flex-start;
    padding: 1rem;
    height: auto;
    min-height: 100vh;
  }

  .auth-card {
    max-width: 92vw;
    padding: 1rem 1rem 0.9rem;
    border-radius: 20px;
  }

  .brand-logo1 {
    width: 140px;
    height: 140px;
  }
  .auth-card .d-flex {
    gap: 8px;
    flex-wrap: wrap; /* allow wrap on tiny screens */
  }
  .brand-logo2,
  .brand-logo3 {
    width: 120px;
    height: 80px;
    flex: 0 0 120px;
  }

  .login-btn {
    width: 120px;
    font-size: 0.72rem;
  }
}

/* sm: 600–899.98 */
@media (min-width: 600px) and (max-width: 899px) {
  /* Small tablets */
  .side-panel {
    justify-content: center;
    padding: 1.2rem 1.6rem;
  }
  .auth-card {
    max-width: 440px;
  }
  .brand-logo1 {
    width: 170px;
    height: 170px;
  }
  .auth-card .d-flex {
    gap: 10px;
  }
  .brand-logo2,
  .brand-logo3 {
    width: 130px;
    height: 86px;
    flex: 0 0 130px;
  }
}

/* md: 900–1199.98 */
@media (min-width: 900px) and (max-width: 1199px) {
  /* Medium laptops */
  .side-panel {
    justify-content: flex-end;
    padding: 1.8rem 2.2rem;
  }
  .auth-card {
    max-width: 480px;
  }
  .auth-card .d-flex {
    gap: 10px;
  }
  .brand-logo2,
  .brand-logo3 {
    width: 150px;
    height: 100px;
    flex: 0 0 150px;
  }
}

/* lg: 1200–1535.98 */
@media (min-width: 1200px) and (max-width: 1535px) {
  .auth-card.single {
    max-width: 420px;
  }
  .auth-card .d-flex {
    gap: 12px;
  }
  /* Ensure two logos fit within 420px card width without overflow */
  .brand-logo2,
  .brand-logo3 {
    width: 150px;
    height: 100px;
    flex: 0 0 150px;
  }
}

/* xl: ≥1536 (no max) */
@media (min-width: 1536px) {
  /* Extra-large desktops */
  .auth-card.single {
    max-width: 520px;
  }
  .brand-logo1 {
    width: 220px;
    height: 220px;
  }
  .auth-card .d-flex {
    gap: 14px;
  }
}
