/* ===== Base ===== */
body {
  margin: 0;
  background-color: #f4f7f9;
  font-family: "Microsoft JhengHei", sans-serif;
}

/* Sembunyikan body saat precheck token */
html.precheck body {
  visibility: hidden;
}

/* ===== Header ===== */
.admin-header {
  background-color: #f5f5f5;
  border-bottom: 1px solid #ddd;
  padding: 10px 20px;
  display: flex;
  align-items: center;
}

.admin-header-left {
  display: flex;
  align-items: center;
  font-weight: bold;
  font-size: 15px;
  color: #333;
}

.logo-box {
  width: 30px;
  height: 30px;
  background-color: #ccc;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-right: 10px;
  font-weight: bold;
  font-size: 14px;
}

/* ===== Login Layout ===== */
.login-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  height: calc(100vh - 60px); /* bar height offset */
}

.login-box {
  background: #fff;
  padding: 2rem;
  border-radius: 6px;
  width: 400px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.login-box h2 {
  text-align: center;
  margin-bottom: 1rem;
  font-size: 18px;
  font-weight: bold;
}

/* ===== Form ===== */
.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  font-weight: bold;
  display: block;
  margin-bottom: 5px;
}

label .req {
  color: #d32f2f;
  margin-left: 0.25rem;
}

.form-control {
  width: 100%;
  padding: 0.5rem;
  font-size: 14px;
}

.form-control.invalid {
  border-color: #d32f2f;
}

/* Password rule checklist */
.pwd-box {
  margin-top: 0.5rem;
  font-size: 0.9rem;
}
.pwd-rules {
  margin: 0.25rem 0 0;
  padding-left: 1.2rem;
}
.pwd-rules li {
  color: #666;
}
.pwd-rules li.ok {
  color: #1b5e20;
  font-weight: 600;
}
.pwd-error {
  color: #d32f2f;
  margin-top: 0.25rem;
  display: none;
}

/* ===== Buttons ===== */
.btn-login {
  background-color: #003554;
  color: #fff;
  border: none;
  width: 100%;
  padding: 0.6rem;
  cursor: pointer;
  font-weight: bold;
  font-size: 15px;

  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-width: 120px;
  height: 30px;
  border-radius: 8px;
  transition: opacity 0.2s ease;
}
.btn-login[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-login .spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.btn-login.loading .spinner {
  display: inline-block;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ===== Misc ===== */
.forgot-text {
  text-align: center;
  margin-top: 1rem;
  font-size: 12px;
  color: #666;
}

.btn-dark {
  background-color: #000;
  border: none;
}
.btn-dark:hover {
  background-color: #333;
}

.form-check-input:checked {
  background-color: #28a745;
  border-color: #28a745;
}

.section-title {
  position: relative;
  padding-left: 12px;
  margin: 0;
}
.section-title::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background-color: #b48a3a;
  border-radius: 2px;
}
/* password field + eye button */
.pw-field {
  position: relative;
  display: flex;
  align-items: center;
}
.pw-field input {
  flex: 1;
  padding-right: 44px; /* ruang untuk tombol mata */
}
.eye-btn {
  position: absolute;
  right: 10px;
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  background: transparent;
  border: 0;
  cursor: pointer;
  color: #555;
  z-index: 2;
}
.eye-btn:hover {
  color: #000;
}
.eye-btn .icon {
  width: 20px;
  height: 20px;
}
.eye-btn .icon-eye-off {
  display: none;
}
.eye-btn.on .icon-eye {
  display: none;
}
.eye-btn.on .icon-eye-off {
  display: block;
}

/* ===== Login modal (error) ===== */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: none; /* hidden by default */
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 2000;
}
.modal-mask.show {
  display: flex;
}

.modal-card {
  background: #fff;
  width: 100%;
  max-width: 520px;
  border-radius: 10px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
  overflow: hidden;
}

.modal-head {
  padding: 20px 24px 8px;
  font-size: 20px;
  font-weight: 700;
}

.modal-body {
  padding: 8px 24px 24px;
  color: #333;
}

.modal-actions {
  padding: 0 24px 24px;
  display: flex;
  justify-content: flex-end;
}

.btn-primary-dark {
  background: #0b1320; /* dark */
  color: #fff;
  border: 0;
  border-radius: 999px;
  font-weight: 700;
  padding: 10px 20px;
  cursor: pointer;
}
.btn-primary-dark:hover {
  filter: brightness(1.08);
}
