:root {
  --auth-paper: #fffdf8;
  --auth-page: #f4f0e8;
  --auth-ink: #403932;
  --auth-muted: #877e74;
  --auth-line: #ddd3c5;
  --auth-red: #ad463e;
  --auth-red-dark: #8f332d;
  --auth-shadow: rgba(70, 54, 42, 0.12);
}

* { box-sizing: border-box; }

body.quiz-auth-page {
  min-height: 100vh;
  margin: 0;
  color: var(--auth-ink);
  background:
    radial-gradient(circle at 22% 18%, rgba(255, 255, 255, 0.86), transparent 30%),
    var(--auth-page);
  font-family: "Noto Serif SC", "Songti SC", "SimSun", serif;
}

.quiz-auth-shell {
  width: min(100% - 36px, 520px);
  margin: 0 auto;
  padding: clamp(56px, 10vh, 110px) 0 60px;
}

.quiz-auth-brand {
  display: inline-flex;
  align-items: baseline;
  gap: 14px;
  margin: 0 0 24px 12px;
  color: var(--auth-ink);
  text-decoration: none;
}

.quiz-auth-brand span {
  font-size: 24px;
  letter-spacing: 0.28em;
}

.quiz-auth-brand small {
  color: var(--auth-muted);
  font-family: Georgia, serif;
  font-size: 12px;
  font-style: italic;
  letter-spacing: 0.18em;
}

.quiz-auth-card {
  padding: clamp(32px, 7vw, 54px);
  border: 1px solid var(--auth-line);
  border-radius: 24px;
  background: var(--auth-paper);
  box-shadow: 0 28px 80px var(--auth-shadow);
}

.quiz-auth-kicker {
  margin-bottom: 18px;
  color: var(--auth-red);
  font-family: Georgia, serif;
  font-size: 12px;
  font-style: italic;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.quiz-auth-card h1 {
  margin: 0;
  font-size: clamp(30px, 7vw, 42px);
  font-weight: 400;
  letter-spacing: 0.08em;
}

.quiz-auth-intro {
  margin: 18px 0 30px;
  color: var(--auth-muted);
  font-size: 15px;
  line-height: 1.85;
}

.quiz-auth-form,
.quiz-auth-form label {
  display: grid;
}

.quiz-auth-form { gap: 20px; }

.quiz-auth-form label { gap: 9px; }

.quiz-auth-form label > span {
  font-size: 14px;
  letter-spacing: 0.08em;
}

.quiz-auth-form input:not([type="checkbox"]) {
  width: 100%;
  height: 50px;
  padding: 0 16px;
  border: 1px solid var(--auth-line);
  border-radius: 8px;
  outline: none;
  color: var(--auth-ink);
  background: #fffefa;
  font: 16px/1.4 system-ui, sans-serif;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.quiz-password-field {
  position: relative;
  display: block;
}

.quiz-password-field input:not([type="checkbox"]) {
  padding-right: 52px;
}

.quiz-password-field [data-password-toggle] {
  position: absolute;
  top: 50%;
  right: 8px;
  display: grid;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  place-items: center;
  color: var(--auth-muted);
  background: transparent;
  cursor: pointer;
  transform: translateY(-50%);
}

.quiz-password-field [data-password-toggle]:hover,
.quiz-password-field [data-password-toggle]:focus-visible {
  color: var(--auth-red);
  background: rgba(173, 70, 62, 0.08);
  outline: none;
}

.quiz-password-field [data-password-toggle] svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.quiz-auth-form input:not([type="checkbox"]):focus {
  border-color: var(--auth-red);
  box-shadow: 0 0 0 3px rgba(173, 70, 62, 0.10);
}

.quiz-auth-form .quiz-auth-remember {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--auth-muted);
}

.quiz-auth-remember input {
  width: 16px;
  height: 16px;
  accent-color: var(--auth-red);
}

.quiz-auth-message {
  min-height: 22px;
  margin: -4px 0;
  color: var(--auth-red-dark);
  font: 14px/1.6 system-ui, sans-serif;
}

.quiz-auth-submit {
  height: 52px;
  border: 1px solid var(--auth-red);
  border-radius: 8px;
  color: #fff;
  background: var(--auth-red);
  font-family: inherit;
  font-size: 16px;
  letter-spacing: 0.14em;
  cursor: pointer;
  transition: background 160ms ease, transform 160ms ease;
}

.quiz-auth-submit:hover { background: var(--auth-red-dark); }
.quiz-auth-submit:active { transform: translateY(1px); }
.quiz-auth-submit:disabled { cursor: wait; opacity: 0.62; }

@media (max-width: 560px) {
  .quiz-auth-shell { width: min(100% - 24px, 520px); padding-top: 34px; }
  .quiz-auth-card { padding: 30px 22px; border-radius: 18px; }
}
