:root {
  --bg: #0d1117;
  --card: #161b22;
  --text: #c9d1d9;
  --accent: #58a6ff;
  --border: #30363d;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  background: linear-gradient(135deg, #0d1117, #010409);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px;
  max-width: 520px;
  width: 90%;
  text-align: center;
  box-shadow: 0 20px 40px rgba(0,0,0,0.5);
  animation: fadeIn 0.8s ease;
}

h1 {
  font-size: 2.2rem;
  margin-bottom: 20px;
  color: white;
}

h1 span {
  color: var(--accent);
}

.buttons {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  padding: 12px 22px;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.25s ease;
  border: 1px solid var(--border);
}

.btn.primary {
  background: var(--accent);
  color: #0d1117;
}

.btn.primary:hover {
  background: #79c0ff;
  transform: translateY(-2px);
}

.btn.secondary {
  color: var(--text);
}

.btn.secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

footer {
  margin-top: 32px;
  font-size: 0.85rem;
  opacity: 0.6;
}

.admin-link-wrap {
  margin-top: 18px;
}

.admin-link {
  font-size: 0.78rem;
  color: #555;
  text-decoration: none;
  letter-spacing: 0.03em;
  transition: color 0.2s;
}

.admin-link:hover {
  color: var(--accent);
}

/* ===== POPUP PASSWORD ===== */
.popup {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

.popup-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
  width: 90%;
  max-width: 360px;
  text-align: center;
  animation: fadeIn 0.3s ease;
}

.popup-box h3 {
  color: white;
  margin-bottom: 14px;
}

.popup-box input {
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: white;
  outline: none;
}

.popup-box input:focus {
  border-color: var(--accent);
}

.popup-buttons {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.popup-buttons button {
  flex: 1;
  padding: 10px;
  border-radius: 8px;
  border: none;
  font-weight: 600;
  cursor: pointer;
}

.popup-buttons button:first-child {
  background: var(--accent);
  color: #0d1117;
}

.popup-buttons .cancel {
  background: #30363d;
  color: var(--text);
}

#errorText {
  color: #ff7b72;
  font-size: 0.85rem;
  margin-top: 8px;
}

.password-wrapper {
  position: relative;
}

#togglePassword {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  color: var(--text);
}

#togglePassword:hover {
  color: var(--accent);
}


@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== SHAKE ANIMATION ===== */
@keyframes shake {
  0%   { transform: translateX(0); }
  20%  { transform: translateX(-6px); }
  40%  { transform: translateX(6px); }
  60%  { transform: translateX(-4px); }
  80%  { transform: translateX(4px); }
  100% { transform: translateX(0); }
}

.popup-box.shake {
  animation: shake 0.35s ease;
}

/* ===== PASSWORD WRAPPER ===== */
.password-wrapper {
  position: relative;
  width: 100%;
}

.password-wrapper input {
  width: 100%;
  padding-right: 44px; /* chừa chỗ cho icon */
}

#togglePassword {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  color: var(--text);
  opacity: 0.7;
}

#togglePassword:hover {
  opacity: 1;
}

#errorText {
  color: #ff4d4f;
  font-size: 14px;
  margin-top: 8px;
  min-height: 18px;
  opacity: 0;
  transition: opacity 0.25s ease;
}


