/* ===============================
   QLIBS LOGIN — LIBRARY CARD / QR ATTENDANCE THEME
   =============================== */

/* ===== GLOBAL RESET ===== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --indigo: #1A1851;
  --indigo-deep: #100E33;
  --gold: #FCB316;
  --gold-deep: #E09A00;
  --parchment: #FBF8F2;
  --ink: #201C3D;
  --slate: #706C8A;
  --hairline: #E6E1D3;
  --danger: #C0392B;
  --danger-bg: #FBEAE8;
  --success: #1E8449;
  --success-bg: #E9F7EF;

  /* Offline-safe fonts: no CDN. Georgia (serif, widely available) carries the
     "library / catalog" register for the headline; Poppins is used if the
     project already self-hosts it (see note below), falling back to the
     system UI stack for body text everywhere else. */
  --font-display: Georgia, "Times New Roman", serif;
  --font-body: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ===== BODY ===== */
body {
  font-family: var(--font-body);
  background:
    linear-gradient(300deg, rgba(16, 14, 51, 0.90) 0%, rgba(26, 24, 81, 0.88) 35%, rgba(252, 179, 22, 0.88) 100%),
    url('../icons/library.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  color: var(--ink);
}

/* ===== LOGIN CONTAINER ===== */
.login-container {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

/* ===== LOGIN CARD ===== */
.login-card {
  background-color: var(--parchment);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(16, 14, 51, 0.35);
  width: 100%;
  max-width: 920px;
  display: grid;
  grid-template-columns: 44px 1fr 1fr;
  overflow: hidden;
  animation: fadeIn 0.7s ease-out;
}

/* ===== SPINE LABEL (signature element) =====
   A vertical strip styled after a library book-spine tag, running the
   full height of the card between the outer edge and the brand panel. */
.login-spine {
  background: var(--gold);
  background-image: repeating-linear-gradient(
    0deg,
    rgba(16, 14, 51, 0.06) 0px,
    rgba(16, 14, 51, 0.06) 1px,
    transparent 1px,
    transparent 10px
  );
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.login-spine span {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-family: var(--font-display);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 3px;
  color: var(--indigo-deep);
  white-space: nowrap;
  text-transform: uppercase;
}

/* ===== LEFT PANEL: BRAND ===== */
.login-image-section {
  background:
    radial-gradient(rgba(255, 255, 255, 0.09) 1.4px, transparent 1.4px),
    linear-gradient(160deg, var(--indigo) 0%, var(--indigo-deep) 100%);
  background-size: 16px 16px, cover;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 50px 36px;
}

.login-image-section .logo-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.login-logo {
  width: 220px;
  height: auto;
  max-width: 100%;
  margin-bottom: 22px;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.3));
}

.logo-text h2 {
  font-family: var(--font-display);
  color: var(--gold);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 1.5px;
  margin-bottom: 8px;
}

.logo-text p {
  color: rgba(255, 255, 255, 0.75);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 0;
}

/* ===== RIGHT PANEL: LOGIN FORM ===== */
.login-form-section {
  padding: 50px 44px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.login-form-section h3 {
  font-family: var(--font-display);
  color: var(--indigo);
  font-size: 25px;
  font-weight: 700;
  margin-bottom: 6px;
  text-align: center;
}

.login-form-subtitle {
  color: var(--slate);
  font-size: 13.5px;
  margin-bottom: 28px;
  text-align: center;
}

.form-logo-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin: 0 auto 24px;
}

.form-logo {
  width: 42px;
  height: auto;
  max-width: 100%;
}

.login-form-section form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* ===== INPUT GROUP ===== */
.input-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.input-group label {
  color: var(--indigo);
  font-weight: 600;
  font-size: 13px;
}

.input-group input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--hairline);
  background: #fff;
  border-radius: 10px;
  font-size: 14px;
  font-family: var(--font-body);
  color: var(--ink);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input-group input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 4px rgba(252, 179, 22, 0.18);
  outline: none;
}

.input-group input::placeholder {
  color: #B4B0C4;
}

/* ===== INPUT WITH ICON (Bootstrap Icons) ===== */
.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}

.input-with-icon .input-icon {
  position: absolute;
  left: 14px;
  font-size: 16px;
  color: var(--slate);
  pointer-events: none;
  transition: color 0.2s ease;
}

.input-with-icon input {
  padding-left: 42px;
}

.input-with-icon.password-wrapper input {
  padding-right: 42px;
}

.input-with-icon:focus-within .input-icon {
  color: var(--gold-deep);
}

/* ===== PASSWORD TOGGLE ===== */
.password-wrapper {
  position: relative;
}

.toggle-password {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  background: transparent;
  border: none;
}

.toggle-password i {
  font-size: 16px;
  color: var(--slate);
}

.toggle-password:hover i {
  color: var(--indigo);
}

/* ===== BUTTON ===== */
.btn-login {
  width: 100%;
  background: var(--indigo);
  color: #ffffff;
  border: none;
  padding: 13px;
  border-radius: 10px;
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
  margin-top: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-login i {
  font-size: 15px;
}

.btn-login:hover {
  background: var(--gold-deep);
  color: var(--indigo-deep);
  transform: translateY(-1px);
}

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

/* ===== ALERTS ===== */
.alert {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  padding: 11px 14px;
  margin-bottom: 16px;
  border-radius: 8px;
  font-weight: 500;
  border-left: 3px solid;
}

.alert-danger {
  background: var(--danger-bg);
  color: var(--danger);
  border-left-color: var(--danger);
}

.alert-success {
  background: var(--success-bg);
  color: var(--success);
  border-left-color: var(--success);
}

/* ===== FORGOT PASSWORD LINK ===== */
.forgot-password-link {
  text-align: center;
  margin-top: 22px;
}

.forgot-password-link a {
  color: var(--slate);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.forgot-password-link a:hover {
  color: var(--indigo);
  border-color: var(--gold);
}

/* ===== ANIMATION ===== */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .login-card {
    animation: none;
  }
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 1024px) {
  .login-card {
    max-width: 800px;
  }

  .login-form-section,
  .login-image-section {
    padding: 40px 32px;
  }

  .login-logo {
    width: 170px;
  }
}

@media (max-width: 768px) {
  body {
    padding: 15px;
  }

  .login-card {
    grid-template-columns: 1fr;
    max-width: 460px;
  }

  .login-spine {
    display: none;
  }

  .login-form-section {
    order: 2;
    padding: 34px 28px;
  }

  .login-image-section {
    order: 1;
    padding: 32px 28px;
  }

  .login-logo {
    width: 130px;
    margin-bottom: 14px;
  }

  .logo-text h2 {
    font-size: 21px;
  }

  .login-form-section h3 {
    font-size: 21px;
  }
}

@media (max-width: 480px) {
  .login-card {
    border-radius: 12px;
  }

  .login-form-section,
  .login-image-section {
    padding: 26px 20px;
  }

  .login-form-section h3 {
    font-size: 19px;
  }

  .btn-login {
    font-size: 13.5px;
    padding: 12px;
  }
}

/* ===============================
   AUTH CARD — Forgot / Reset Password
   Centered single-panel card used by
   forgot_password.php & reset_password.php
   =============================== */

.auth-card {
  background-color: var(--parchment);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(16, 14, 51, 0.35);
  width: 100%;
  max-width: 440px;
  padding: 44px 40px 36px;
  display: flex;
  flex-direction: column;
  animation: fadeIn 0.6s ease-out;
  border-top: 4px solid var(--gold);
}

/* Logo row centered at top to match the login page branding */
.auth-logo-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 24px;
}

.auth-logo {
  width: 54px;
  height: auto;
  filter: drop-shadow(0 4px 10px rgba(16, 14, 51, 0.22));
}

.auth-logo.auth-logo-library {
  width: 60px;
}

.auth-logo.auth-logo-ustp,
.auth-logo.auth-logo-system {
  width: 42px;
}

/* Card heading */
.auth-card h3 {
  font-family: var(--font-display);
  color: var(--indigo);
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 6px;
  text-align: center;
}

/* Subtitle / description */
.auth-subtitle {
  color: var(--slate);
  font-size: 13.5px;
  line-height: 1.55;
  margin-bottom: 24px;
  text-align: center;
}

/* Form inside auth card */
.auth-card form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Small hint text below input */
.field-hint {
  font-size: 12px;
  color: var(--slate);
  margin-top: 4px;
}

/* Back to login link at the bottom */
.back-to-login {
  margin-top: 22px;
  text-align: center;
}

.back-to-login a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--slate);
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.back-to-login a i {
  font-size: 14px;
  transition: transform 0.2s ease;
}

.back-to-login a:hover {
  color: var(--indigo);
  border-color: var(--gold);
}

.back-to-login a:hover i {
  transform: translateX(-3px);
}

/* Responsive tweaks for auth-card */
@media (max-width: 480px) {
  .auth-card {
    padding: 32px 24px 28px;
    border-radius: 12px;
  }

  .auth-card h3 {
    font-size: 19px;
  }

  .auth-logo {
    width: 58px;
  }
}