/* ==========================================================================
   SAMAGAM Login Page (new design)
   Loaded only by Modules/User/Views/inc/login.php — the old login styles
   remain untouched in login.css. Uses lg-* class names to avoid conflicts.
   ========================================================================== */

/* The mockup has no site header/footer on the login screen — hide them here.
   This stylesheet loads only on the login page, so no other page is affected. */
body {
  padding-top: 0;
}

.site-header,
.site-footer {
  display: none;
}

/* ---------------- Page ---------------- */

.lg-page {
  position: relative;
  z-index: 0;
  min-height: 100vh;
  /* The one background of the sign-in pages. The moving video that used to
     cover it was 80 MB fetched by every visitor and stands withdrawn. */
  background-image: url(../../images/loginbg.jpg);
  background-size: cover;
  background-position: center bottom;
  background-repeat: no-repeat;
  display: flex;
  flex-direction: column; 
  align-items: center;
  justify-content: center;
  padding: 50px 20px;
  font-family: 'Montserrat', sans-serif;
  box-sizing: border-box;
}

/* Video background — CSS background-image cannot play .mp4 files, so the
   pages render a <video class="lg-bg-video"> as the first child of .lg-page.
   z-index: -1 keeps it above the fallback image but below the page content. */
.lg-bg-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center bottom;
  z-index: -2;
  pointer-events: none;
}

/* A dimming veil between the video and the card: the collage stays alive but
   recedes, so the login is what the eye lands on. Lighter at the centre where
   the card sits, darker toward the edges, with a touch of blur to calm the
   busy footage. Sits at -1 - above the video (-2), below the content. */
.lg-page::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(
    ellipse at center,
    rgba(47, 29, 49, 0.35) 0%,
    rgba(34, 23, 36, 0.55) 60%,
    rgba(49, 33, 51, 0.7) 100%
  );
  backdrop-filter: blur(1px);
  -webkit-backdrop-filter: blur(3px);
}

/* ---------------- Brand ---------------- */

/* Lives inside the card, above the title - on the white it reads cleanly
   where over the video it fought the photograph. Logo on the left, the name
   beside it on the right, the pair centred as one line. */
.lg-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid #f0e7f1;
}

.lg-brand img {
  width: 64px;
  height: auto;
  display: block;
  flex: 0 0 auto;
  margin: 0;
}

.lg-brand h1 {
  font-size: 30px;
  font-weight: 800;
  color: #632765;
  margin: 0;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

/* ---------------- Card ---------------- */

.lg-card {
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(74, 31, 76, 0.16);
  padding: 20px 50px;
  width: 100%;
  max-width: 600px;
  box-sizing: border-box;
}

.lg-card-title {
  font-size: 24px;
  font-weight: 800;
  color: #632765;
  text-align: center;
  margin: 0 0 10px;
}

.lg-card-sub {
  font-size: 16px;
  color: #1f2937;
  text-align: center;
  margin: 0 0 20px;
}

/* info note (forgot password instruction) */
.lg-note {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: #fbf3fb;
  border: 1px solid #eed9ee;
  border-left: 4px solid #632765;
  border-radius: 10px;
  padding: 14px 16px;
  margin: 0 0 30px;
  font-size: 14px;
  line-height: 1.6;
  color: #5d275d;
  text-align: left;
}

.lg-note svg {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  margin-top: 2px;
  color: #632765;
}

/* ---------------- Fields ---------------- */

.lg-field {
  margin-bottom: 22px;
}

.lg-field > label {
  display: block;
  font-size: 16px;
  font-weight: 600;
  color: #111827;
  margin-bottom: 10px;
}

.lg-input {
  width: 100%;
  padding: 13px 16px;
  font-size: 15px;
  font-family: 'Montserrat', sans-serif;
  color: #111827;
  background: #ffffff;
  border: 1px solid #d7dbe7;
  border-radius: 10px;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.lg-input::placeholder {
  color: #9aa3b2;
}

.lg-input:focus {
  border-color: #632765;
  box-shadow: 0 0 0 3px rgba(155, 77, 150, 0.18);
}

.lg-input.is-invalid {
  border-color: #dc2626;
}

.lg-card .invalid-feedback {
  display: block;
  color: #dc2626;
  font-size: 13px;
  margin-top: 6px;
}

/* password eye toggle */
.lg-pass-wrap {
  position: relative;
}

.lg-pass-wrap .lg-input {
  padding-right: 46px;
}

.lg-pass-toggle {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  user-select: none;
  color: #6b7280;
  display: inline-flex;
  align-items: center;
}

/* ---------------- Captcha row ---------------- */

.lg-captcha-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.lg-captcha-row .lg-captcha-input {
  flex: 1 1 auto;
  min-width: 0;
}

.lg-captcha-img {
  height: 48px;
  width: 130px;
  object-fit: cover;
  border-radius: 10px;
  display: block;
  cursor: pointer;
  transition: opacity 0.25s ease;
}

.lg-captcha-img.fading,
.lg-captcha-img.fade-out {
  opacity: 0.25;
}

.lg-captcha-refresh {
  width: 30px;
  height: 30px;
  cursor: pointer;
  flex: 0 0 auto;
}

/* Spins while a new captcha is being fetched */
.lg-captcha-refresh.spinning {
  animation: lg-spin 0.6s linear infinite;
  pointer-events: none;
}

@keyframes lg-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .lg-captcha-refresh.spinning {
    animation-duration: 1s;
  }
}

/* ---------------- Submit & links ---------------- */

.lg-submit {
  width: 100%;
  margin-top: 10px;
  padding: 14px 20px;
  font-size: 16px;
  font-weight: 600;
  font-family: 'Montserrat', sans-serif;
  color: #ffffff;
  background: linear-gradient(135deg, #632765 0%, #9b4d96 55%, #ff657d 100%);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.25s ease, box-shadow 0.25s ease;
}

.lg-submit:hover {
  background: linear-gradient(135deg, #4a1f4c 0%, #7b3f77 55%, #e14d67 100%);
  box-shadow: 0 10px 24px rgba(99, 39, 101, 0.3);
}

.lg-forgot {
  display: block;
  text-align: center;
  margin-top: 22px;
  font-size: 16px;
  color: #632765;
  text-decoration: none;
  font-weight: 500;
}

.lg-forgot:hover {
  text-decoration: underline;
  color: #4a1f4c;
}

/* ---------------- Responsive ---------------- */

@media (max-width: 640px) {
  .lg-page {
    padding: 36px 14px;
  }

  .lg-card {
    padding: 30px 22px;
    border-radius: 16px;
  }

  .lg-brand {
    gap: 12px;
  }

  .lg-brand img {
    width: 52px;
  }

  .lg-brand h1 {
    font-size: 24px;
  }

  .lg-captcha-row {
    flex-wrap: wrap;
  }

  .lg-captcha-row .lg-captcha-input {
    flex: 1 1 100%;
  }
}
