/* ============================================================
   AgentLab — Sign-in Page Styles
   Dark, modern, dependency-free
   ============================================================ */

:root {
  --bg: #07070d;
  --surface: rgba(255, 255, 255, 0.028);
  --surface-2: rgba(255, 255, 255, 0.05);
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #eceef8;
  --muted: #9ea1ba;
  --muted-2: #6f7288;
  --accent: #7c5cff;
  --accent-2: #22d3ee;
  --danger: #f87171;
  --grad: linear-gradient(120deg, #7c5cff 0%, #22d3ee 100%);
  --radius: 16px;
  --radius-sm: 11px;
  --shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.75);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
          "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 48px 20px;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  letter-spacing: 0.1px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
h1 { margin: 0; line-height: 1.25; font-weight: 700; letter-spacing: -0.02em; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }

/* ---------- ambient background ---------- */
.auth__bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(760px 420px at 50% -8%, rgba(124, 92, 255, 0.20), transparent 70%),
    radial-gradient(620px 380px at 88% 108%, rgba(34, 211, 238, 0.12), transparent 72%);
}
.auth__bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.028) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(circle at 50% 32%, #000 0%, transparent 78%);
  -webkit-mask-image: radial-gradient(circle at 50% 32%, #000 0%, transparent 78%);
}

/* ---------- layout ---------- */
.auth {
  width: 100%;
  max-width: 412px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.card {
  padding: 36px 32px 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.018));
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

/* ---------- card head ---------- */
.card__head { text-align: center; margin-bottom: 28px; }
.card__title { font-size: 23px; }
.card__sub { margin-top: 7px; font-size: 13.5px; color: var(--muted-2); }

/* ---------- form ---------- */
.form { display: flex; flex-direction: column; gap: 17px; }

.field { display: flex; flex-direction: column; gap: 8px; }
.field__label { font-size: 13.5px; font-weight: 500; color: var(--muted); }
.field__input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
  font-family: inherit;
  font-size: 14.5px;
  line-height: 1.5;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}
.field__input::placeholder { color: var(--muted-2); }
.field__input:hover { border-color: var(--border-strong); }
.field__input:focus {
  border-color: rgba(124, 92, 255, 0.75);
  background: rgba(255, 255, 255, 0.055);
  box-shadow: 0 0 0 3.5px rgba(124, 92, 255, 0.16);
}
.field__input:-webkit-autofill {
  -webkit-text-fill-color: var(--text);
  -webkit-box-shadow: 0 0 0 1000px #14141f inset;
}
.field__input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.field__input:disabled:hover { border-color: var(--border); }

/* ---------- row: remember / forgot ---------- */
.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: -2px;
  font-size: 13.5px;
}
.check { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); cursor: pointer; user-select: none; }
.check__input { position: absolute; opacity: 0; width: 0; height: 0; }
.check__box {
  position: relative;
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.035);
  transition: background 0.18s ease, border-color 0.18s ease;
}
.check__box::after {
  content: "";
  position: absolute;
  left: 4.5px;
  top: 1.5px;
  width: 4px;
  height: 8px;
  border-right: 1.8px solid #fff;
  border-bottom: 1.8px solid #fff;
  transform: rotate(42deg) scale(0);
  transition: transform 0.16s ease;
}
.check__input:checked + .check__box { background: var(--accent); border-color: var(--accent); }
.check__input:checked + .check__box::after { transform: rotate(42deg) scale(1); }
.check__input:focus-visible + .check__box { box-shadow: 0 0 0 3.5px rgba(124, 92, 255, 0.2); }
.check__input:disabled ~ .check__box,
.check__input:disabled ~ .check__text { opacity: 0.5; }
.check__input:disabled ~ .check__box { cursor: not-allowed; }

.link { color: var(--muted); transition: color 0.18s ease; }
.link:hover { color: var(--accent-2); }

/* ---------- alert ---------- */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid rgba(248, 113, 113, 0.3);
  border-radius: 10px;
  background: rgba(248, 113, 113, 0.09);
  color: var(--danger);
  font-size: 13.5px;
  line-height: 1.5;
}
.alert[hidden] { display: none; }
.alert::before {
  content: "!";
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  margin-top: 2px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(248, 113, 113, 0.2);
  font-size: 11px;
  font-weight: 700;
}

/* ---------- submit ---------- */
.submit {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  margin-top: 4px;
  padding: 13px 20px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--grad);
  color: #fff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: opacity 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}
.submit:hover { transform: translateY(-1px); box-shadow: 0 14px 30px -14px rgba(124, 92, 255, 0.85); }
.submit:active { transform: translateY(0); }
.submit:focus-visible { outline: none; box-shadow: 0 0 0 3.5px rgba(124, 92, 255, 0.28); }
.submit:disabled { opacity: 0.72; cursor: default; transform: none; box-shadow: none; }

.submit__spinner { display: none; width: 14px; height: 14px; }
.submit.is-loading .submit__spinner {
  display: block;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- back link ---------- */
.back {
  align-self: center;
  font-size: 13.5px;
  color: var(--muted);
  transition: color 0.18s ease;
}
.back:hover { color: var(--accent-2); }
.back:focus-visible { outline: none; color: var(--accent-2); }

/* ---------- footer ---------- */
.foot { text-align: center; font-size: 12.5px; color: var(--muted-2); }
.foot__copy { margin-bottom: 6px; }
.foot__beian a { color: var(--muted-2); transition: color 0.18s ease; }
.foot__beian a:hover { color: var(--muted); }
.foot__police {
  margin-top: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.foot__police img { height: 15px; width: auto; display: block; }
.foot__police a { color: var(--muted-2); transition: color 0.18s ease; }
.foot__police a:hover { color: var(--muted); }

/* ---------- responsive ---------- */
@media (max-width: 460px) {
  body { padding: 32px 16px; }
  .card { padding: 30px 22px 26px; }
  .card__title { font-size: 21px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}
