/* Trang đăng nhập. Màu và nút dùng chung biến trong style.css để sáng/tối khớp với trang quản lý. */

.login-page {
  min-height: 100vh;
  min-height: 100dvh;
  background:
    radial-gradient(900px 420px at 50% -8%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%),
    var(--bg);
}

.login-shell {
  min-height: inherit;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 16px;
  padding: 24px 16px;
}

.login-card {
  width: min(400px, calc(100vw - 32px));
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px 28px 24px;
  box-shadow: 0 10px 30px rgba(16, 24, 40, 0.08), 0 2px 6px rgba(16, 24, 40, 0.05);
  text-align: center;
}
@media (prefers-color-scheme: dark) {
  .login-card { box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35); }
}

.login-logo { width: 52px; height: 52px; margin: 0 auto 14px; color: var(--accent); }
.login-logo svg { width: 100%; height: 100%; display: block; }
.login-card h1 { font-size: 20px; }
.login-sub { margin: 6px 0 22px; color: var(--muted); }

.login-card form { display: grid; gap: 10px; text-align: left; }
.login-label { font-weight: 600; }

.pw-wrap { position: relative; }
.pw-wrap input {
  width: 100%;
  min-height: 46px;
  padding: 10px 46px 10px 14px;
  font-size: 16px; /* 16px để iPhone không tự phóng to khi chạm vào ô */
  border-radius: 10px;
}
.pw-toggle {
  position: absolute;
  top: 50%;
  right: 4px;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  min-height: 0;
  padding: 0;
  justify-content: center;
  border: 0;
  background: transparent;
  color: var(--muted);
}
.pw-toggle:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }
.pw-toggle svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.login-hint { font-size: 12px; padding: 6px 10px; border-radius: 8px; }
.login-hint.warn { background: var(--warn-bg); color: var(--warn); }

.remember { display: flex; align-items: center; gap: 8px; color: var(--muted); cursor: pointer; user-select: none; }
.remember input { width: 16px; height: 16px; margin: 0; }

.login-error {
  background: var(--bad-bg);
  color: var(--bad);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
}
.login-error.shake { animation: shake 0.35s ease; }
@keyframes shake {
  20%, 60% { transform: translateX(-5px); }
  40%, 80% { transform: translateX(5px); }
}

.login-submit {
  width: 100%;
  min-height: 46px;
  justify-content: center;
  font-size: 15px;
  border-radius: 10px;
  margin-top: 4px;
}

.login-help { margin-top: 18px; font-size: 12px; color: var(--muted); text-align: left; }
.login-help summary { cursor: pointer; width: fit-content; }
.login-help p { margin: 8px 0 0; }
.login-help code { background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }

.login-foot { margin: 0; font-size: 12px; color: var(--muted); text-align: center; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

@media (max-width: 420px) {
  .login-card { padding: 26px 20px 20px; border-radius: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .login-error.shake { animation: none; }
}
