/*
 * Glass login card shared by login.php (students) and user-login.php (staff).
 * The card, label and heading colours come from the Portal Theme variables
 * (render_portal_theme_styles) on the student page; the fallbacks are the
 * theme defaults, which the staff page uses as-is.
 */
.login-glass-card {
  --login-accent: var(--login-btn-bg, #01acbf);
  width: 100%;
  max-width: 410px;
  min-height: 410px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  margin: 0 auto;
  padding: 20px 20px 16px;
  border-radius: 1rem;
  border: 1px solid rgba(125, 211, 252, 0.45);
  background: var(--portal-login-card-bg, rgba(0, 0, 0, 0.5));
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  font-family: "Poppins", sans-serif;
  text-align: left;
}

.login-glass-head {
  text-align: center;
  margin-bottom: 12px;
}

.login-glass-logo {
  display: block;
  margin: 0 auto 6px;
  width: auto;
  height: 46px;
  max-width: min(200px, 85%);
  object-fit: contain;
}

.login-glass-title {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.25;
  color: var(--portal-login-heading-1-color, #ffffff) !important;
}

.login-glass-subtitle {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--portal-login-heading-2-color, #ffffff) !important;
}

.login-glass-label {
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
  line-height: 1.4;
  font-weight: 500;
  color: var(--portal-login-label-color, #ffffff);
}

.login-glass-field {
  position: relative;
  margin-bottom: 8px;
}

.login-glass-field > .login-glass-icon {
  position: absolute;
  top: 50%;
  left: 12px;
  transform: translateY(-50%);
  font-size: 14px;
  color: #6b7c93;
  pointer-events: none;
}

.login-glass-field .form-control {
  height: 38px;
  padding: 0 42px 0 36px;
  border-radius: 8px;
  border: 1px solid var(--portal-login-input-border, #ced4da);
  background: #ffffff;
  color: #1f2d3d;
  font-size: 14px;
}

.login-glass-field .form-control::placeholder {
  font-size: 14px;
  color: #7a8aa0;
}

.login-glass-field .form-control:focus {
  border-color: var(--login-accent);
  box-shadow: 0 0 0 0.2rem rgba(1, 172, 191, 0.25);
}

.login-glass-eye {
  position: absolute;
  top: 50%;
  right: 5px;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  font-size: 13px;
  border: 0;
  border-radius: 50%;
  background: #e8eef4;
  color: #4a5d73;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.login-glass-eye:hover,
.login-glass-eye:focus-visible {
  background: #d9e3ec;
}

.login-glass-eye:focus-visible {
  outline: 2px solid var(--login-accent);
  outline-offset: 2px;
}

.login-glass-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin: 2px 0 12px;
}

.login-glass-options .form-check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 0;
  min-height: 0;
}

.login-glass-options .form-check .form-check-input {
  float: none;
  width: 16px;
  height: 16px;
  margin: 0;
  border-radius: 4px;
  cursor: pointer;
}

.login-glass-options .form-check-input:checked {
  background-color: var(--login-accent);
  border-color: var(--login-accent);
}

.login-glass-options .form-check-label {
  margin: 0;
  white-space: nowrap;
  font-size: 13px;
  color: var(--portal-login-label-color, #ffffff);
  cursor: pointer;
}

.login-glass-forgot {
  white-space: nowrap;
  font-size: 13px;
  color: var(--login-link-color, #22c3d6);
  text-decoration: none;
}

.login-glass-forgot:hover {
  color: #7fe3ee;
  text-decoration: underline;
}

.login-glass-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  width: 100%;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 10px;
  background: linear-gradient(180deg, #2ccde0 0%, var(--login-accent) 100%);
  color: var(--login-btn-text, #ffffff);
  font-size: 15px;
  font-weight: 600;
  box-shadow: 0 6px 18px rgba(1, 172, 191, 0.35);
  transition: filter 0.15s ease, transform 0.15s ease;
}

/* The arrow is drawn here, not in the markup: login.js / user-login.js reset the
   button text after a failed attempt, which would drop an inline icon. */
.login-glass-submit::after {
  content: "\2192";
  font-size: 16px;
  line-height: 1;
}

.login-glass-submit:has(.fa-spinner)::after {
  content: none;
}

.login-glass-submit:hover {
  filter: brightness(1.06);
  color: var(--login-btn-text, #ffffff);
}

.login-glass-submit:active {
  transform: translateY(1px);
}

.login-glass-footer {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  text-align: center;
  font-size: 10.5px;
  line-height: 1.4;
  color: var(--portal-login-label-color, #ffffff);
  opacity: 0.85;
}

@media (max-width: 575.98px) {
  .login-glass-card {
    min-height: 0;
  }
}

/* login.php: its column wrapper (shared class: col-md-4, 420px) is sized for this card only;
   the grid gutter padding is dropped so the card gets its full 410px. */
.student-login-card-wrap.login-glass-wrap {
  flex: 0 0 auto;
  width: 100%;
  max-width: 410px;
  padding-left: 0;
  padding-right: 0;
}

/* Forgot-password pages (forgot-password.php, user-forgot-password.php). */
.login-glass-section-title {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 600;
  color: var(--portal-login-label-color, #ffffff);
}

.login-glass-text {
  margin: 0 0 12px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--portal-login-label-color, #ffffff);
  opacity: 0.85;
}

.login-glass-text strong {
  font-weight: 600;
  opacity: 1;
}

.login-glass-message {
  min-height: 16px;
  margin: -6px 0 8px;
  font-size: 11.5px;
}

.login-glass-message.text-success {
  color: #6ee7b7 !important;
}

.login-glass-message.text-danger {
  color: #fca5a5 !important;
}

.login-glass-submit:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  filter: none;
  box-shadow: none;
}

.login-glass-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  font-size: 13px;
  color: var(--login-link-color, #22c3d6);
  text-decoration: none;
}

.login-glass-back:hover {
  color: #7fe3ee;
  text-decoration: underline;
}

/* "Connect with us" bar styles: assets/css/login-social-bar.css (loaded by lib/inc/login-social-bar.php). */
/* Leave room above the fixed bar so the card never sits under it. */
@media (min-width: 992px) {
  body:has(.login-social-bar) .student-login-stage {
    padding-bottom: 3rem;
  }
}

/* Phones: one 12px gutter each side instead of the stage padding (24px) stacked
   on the grid container's (16px), so the card uses the screen width. */
@media (max-width: 575.98px) {
  .student-login-stage:has(.login-glass-card) {
    padding-left: 12px;
    padding-right: 12px;
  }

  /* login.php's inner container, and the forgot pages' outer one (which wraps the
     stage). user-login.php's older grid relies on its container padding: left alone. */
  .student-login-container:has(.login-glass-card),
  .container-fluid:has(> .student-login-page .login-glass-card) {
    padding-left: 0;
    padding-right: 0;
  }

  .student-login-row:has(.login-glass-card) {
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
}
