﻿:root {
  --bg0: #eef2f7;
  --bg1: #f3f5f7;
  --card: #ffffff;
  --border: #e7eaee;
  --text: #1d2630;
  --muted: #5b6b79;
  --accent: #4680ff;
  --accent-hi: #2f6fed;
  --err: #dc3545;
  --shadow: 0 24px 48px rgba(27, 46, 94, 0.12);
}
* { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  background: radial-gradient(ellipse 120% 80% at 50% -10%, #dbe6ff 0%, var(--bg0) 55%);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(20px, env(safe-area-inset-top, 0px)) max(20px, env(safe-area-inset-right, 0px)) max(20px, env(safe-area-inset-bottom, 0px)) max(20px, env(safe-area-inset-left, 0px));
  touch-action: manipulation;
}
.shell {
  width: 100%;
  max-width: 420px;
}
.brand {
  text-align: center;
  margin-bottom: 28px;
}
.brand-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent) 0%, #6f9bff 100%);
  border: 0;
  color: #fff;
  font-size: 26px;
  margin-bottom: 14px;
  box-shadow: 0 12px 26px rgba(70, 128, 255, 0.32);
}
.brand h1 {
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
}
.brand p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--muted);
}
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px 28px 26px;
  box-shadow: var(--shadow);
}
.card h2 {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
.err {
  background: rgba(248, 113, 113, 0.12);
  border: 1px solid rgba(248, 113, 113, 0.35);
  color: var(--err);
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.875rem;
  margin: 0 0 18px;
}
label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 6px;
}
.field { margin-bottom: 16px; }
input[type="text"],
input[type="password"] {
  width: 100%;
  padding: 11px 12px;
  background: var(--bg1);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 1rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(70, 128, 255, 0.22);
}
button[type="submit"] {
  width: 100%;
  margin-top: 6px;
  padding: 14px 16px;
  min-height: 48px;
  background: linear-gradient(180deg, var(--accent-hi), var(--accent));
  border: 0;
  border-radius: 8px;
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: filter 0.15s, transform 0.05s;
}
button[type="submit"]:hover { filter: brightness(1.06); }
button[type="submit"]:active { transform: translateY(1px); }
a.btn-discord {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  text-align: center;
  text-decoration: none;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  background: #5865F2;
  border: 0;
  margin-bottom: 16px;
  transition: filter 0.15s, transform 0.05s;
  box-sizing: border-box;
}
a.btn-discord:hover { filter: brightness(1.08); }
a.btn-discord:active { transform: translateY(1px); }
.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0 16px;
  color: var(--muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}
.foot {
  text-align: center;
  margin-top: 22px;
  font-size: 0.75rem;
  color: var(--muted);
}
.oauth-hint {
  margin: 0 0 16px;
  font-size: 0.8125rem;
  color: var(--muted);
  line-height: 1.5;
}
.oauth-hint code { font-size: 0.75em; }

@keyframes ht-login-rise {
  from { opacity: 0; transform: translateY(22px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes ht-login-brand {
  from { opacity: 0; transform: translateY(12px) scale(0.94); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes ht-login-glow {
  0%, 100% { box-shadow: 0 12px 26px rgba(70, 128, 255, 0.32); }
  50% { box-shadow: 0 12px 26px rgba(70, 128, 255, 0.32), 0 0 32px rgba(70, 128, 255, 0.28); }
}
.ht-admin-login .shell {
  animation: ht-login-rise 0.68s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.ht-admin-login .brand {
  animation: ht-login-brand 0.58s 0.06s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.ht-admin-login .card {
  animation: ht-login-rise 0.62s 0.12s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.ht-admin-login .brand-badge {
  animation: ht-login-glow 5s ease-in-out infinite;
}
.ht-admin-login .err {
  animation: ht-login-rise 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@media (prefers-reduced-motion: reduce) {
  .ht-admin-login .shell,
  .ht-admin-login .brand,
  .ht-admin-login .card,
  .ht-admin-login .err {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
  .ht-admin-login .brand-badge {
    animation: none !important;
  }
}

@media (max-width: 380px) {
  body {
    align-items: flex-start;
    padding-top: max(12px, env(safe-area-inset-top, 0px));
  }
  .card {
    padding: 22px 18px 20px;
  }
}
