/* pages/login/login.css
   =====================================================================
   LOGIN FEATURE STYLES — extracted verbatim from the inline <style>
   blocks of the legacy root index.html (login page).

   Design tokens (colors, borders, text, shadows, --topbar-height)
   come from assets/css/theme.css, which this page loads. The legacy
   page duplicated those tokens inline; they are intentionally NOT
   repeated here.

   The only token difference: legacy login overrode --bg-body to
   #f8fafc (theme default is #f1f7fd). The literal value is kept below
   for pixel parity.
   ===================================================================== */

body {
  font-family: "Poppins", sans-serif;
  /* Legacy login background (#f8fafc). Kept literal on purpose — do not
     switch to var(--bg-body) without a visual regression check. */
  background-color: var(--bg-body, #f8fafc);
  color: var(--text);
  /* Membuat body menjadi Flex container vertikal */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  /* Pastikan tinggi minimal setinggi layar */
  margin: 0;
}

/* --- TOP BAR (Fixed) --- */
.top-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--topbar-height);
  background: var(--surface);
  border-bottom: 1px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  /* Center Logo */
  padding: 0 30px;
  z-index: 1001;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
}

/* --- MAIN CONTENT WRAPPER --- */
/* Bagian ini akan mengisi ruang kosong agar footer terdorong ke bawah */
main.main-content-wrapper {
  flex: 1;
  /* Mengambil sisa ruang yang tersedia */
  display: flex;
  align-items: center;
  /* Vertikal Center */
  justify-content: center;
  /* Horizontal Center */
  padding: 20px;
  margin-top: var(--topbar-height);
  /* Kompensasi header fixed */
  width: 100%;
}

.login-card {
  background: var(--surface);
  width: 100%;
  max-width: 400px;
  padding: 40px;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  /* Menghapus margin persen manual agar flexbox yang mengatur posisi */
  margin: 0;
}

.login-header {
  text-align: center;
  margin-bottom: 30px;
}

.login-header h1 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 5px;
  text-transform: uppercase;
  color: var(--dlg-blue);
}

.login-header p {
  color: #666;
  font-size: 14px;
}

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

.form-group label {
  display: block;
  margin-bottom: 8px;
  color: #333;
  font-weight: 500;
  font-size: 14px;
}

.form-group input {
  width: 100%;
  padding: 12px 15px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 16px;
  transition: border-color 0.3s;
}

.form-group input:focus {
  outline: none;
  border-color: #4a90e2;
  box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.btn-login {
  width: 100%;
  color: #fff;
  padding: 12px;
  /* Sedikit diperbesar untuk touch target mobile */
  border-radius: 7px;
  border: 0px;
  font-size: 14px;
  font-weight: 600;
  background: linear-gradient(to bottom, #0f61a8 5%, #0b2b6a 100%);
  box-shadow: 0px 5px 16px -6px rgba(114, 4, 207, 1);
  transition: 0.3s;
  cursor: pointer;
}

.btn-login:hover {
  background: #0b2b6a;
  box-shadow: 0px 0px 4px 2px rgba(114, 4, 207, 0.75);
}

.btn-login:disabled {
  background: #ccc;
  cursor: not-allowed;
  box-shadow: none;
}

.error-message {
  background-color: #ffebee;
  color: #c62828;
  padding: 10px;
  border-radius: 6px;
  font-size: 14px;
  text-align: center;
  margin-bottom: 20px;
  display: none;
  border: 1px solid #ffcdd2;
}

/* --- LOGIN DIVIDER & PRESENCE BUTTON --- */
.login-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 16px 0 14px;
}

.login-divider::before,
.login-divider::after {
  content: "";
  flex: 1;
  border-bottom: 1px solid #e5e7eb;
}

.login-divider span {
  padding: 0 10px;
  font-size: 12px;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.btn-presence {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 11px;
  background-color: #f0f7ff;
  color: #0b2b6a;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.25s ease;
  margin-bottom: 15px;
}

.btn-presence i {
  font-size: 17px;
}

.btn-presence:hover {
  background-color: #0b2b6a;
  color: #ffffff;
  border-color: #0b2b6a;
  box-shadow: 0 4px 12px rgba(11, 43, 106, 0.15);
}

.auth-links {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin-top: 10px;
  border-top: 1px solid #eee;
  padding-top: 20px;
}

.auth-links a {
  text-decoration: none;
  color: #666;
  transition: color 0.3s;
}

.auth-links a:hover {
  color: #4a90e2;
  text-decoration: underline;
}

/* --- FOOTER FIXED STYLE --- */
footer {
  width: 100%;
  margin-top: auto;
  /* Kunci agar footer menempel ke bawah jika konten pendek */
  background: #0b2b6a;
  z-index: 10;
}

#footer {
  font-size: 14px;
  background: #0b2b6a;
  color: #fff;
  padding: 0;
}

#footer .container {
  padding-top: 20px;
  padding-bottom: 20px;
}

#footer .credits {
  padding-top: 5px;
  font-size: 13px;
  color: #444444;
}

#footer .social-links a {
  font-size: 18px;
  display: inline-block;
  background: var(--surface);
  color: #0b2b6a;
  line-height: 1;
  padding: 8px 0;
  margin-right: 4px;
  border-radius: 50%;
  text-align: center;
  width: 36px;
  height: 36px;
  transition: 0.3s;
  box-shadow: 0px -10px 15px -6px rgba(114, 4, 207, 0.75) inset;
  -webkit-box-shadow: 0px -10px 15px -6px rgba(114, 4, 207, 0.75) inset;
  -moz-box-shadow: 0px -10px 15px -6px rgba(114, 4, 207, 0.75) inset;
}

#footer .social-links a:hover {
  background: #7204cf;
  color: #fff;
  text-decoration: none;
  box-shadow: 0px 0px 4px 2px rgba(114, 4, 207, 0.75);
  -webkit-box-shadow: 0px 0px 4px 2px rgba(114, 4, 207, 0.75);
  -moz-box-shadow: 0px 0px 4px 2px rgba(114, 4, 207, 0.75);
}

/* Responsif Mobile */
@media (max-width: 768px) {
  .btn-login {
    padding: 10px;
  }

  /* Pada mobile, jika keyboard muncul, pastikan footer tidak menutupi form */
  main.main-content-wrapper {
    padding: 15px;
    min-height: calc(100vh - var(--topbar-height) - 100px);
    /* Estimasi tinggi */
  }

  #footer .container {
    flex-direction: column;
    text-align: center !important;
    gap: 15px;
  }

  .me-md-auto {
    text-align: center !important;
    margin-bottom: 10px;
  }
}

/* =====================================================================
   DARK MODE OVERRIDES — login.css
   ===================================================================== */
[data-theme="dark"] .login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 4px 25px rgba(0, 0, 0, 0.4);
}
[data-theme="dark"] .login-header h1 {
  color: #60a5fa;
}
[data-theme="dark"] .login-header p {
  color: var(--text-muted);
}
[data-theme="dark"] .form-group label {
  color: var(--text);
}
[data-theme="dark"] .form-group input {
  background: var(--surface-toolbar);
  border-color: var(--border);
  color: var(--text);
}
[data-theme="dark"] .form-group input:focus {
  background: var(--surface);
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.18);
}
[data-theme="dark"] .auth-links {
  border-color: var(--border);
}
[data-theme="dark"] .auth-links a {
  color: var(--text-muted);
}
[data-theme="dark"] .auth-links a:hover {
  color: #60a5fa;
}
[data-theme="dark"] .error-message {
  background-color: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.3);
}
[data-theme="dark"] .login-divider::before,
[data-theme="dark"] .login-divider::after {
  border-color: var(--border);
}
[data-theme="dark"] .login-divider span {
  color: var(--text-muted);
}
[data-theme="dark"] .btn-presence {
  background-color: rgba(59, 130, 246, 0.12);
  color: #60a5fa;
  border-color: rgba(59, 130, 246, 0.3);
}
[data-theme="dark"] .btn-presence:hover {
  background-color: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}
