:root {
  color-scheme: light;
  --auth-canvas: #f3f5f8;
  --auth-surface: #fff;
  --auth-surface-raised: #edf1f7;
  --auth-ink: #15202f;
  --auth-muted: #596679;
  --auth-line: #d9dfe8;
  --auth-primary: #234cea;
  --auth-primary-hover: #183bbd;
  --auth-signal: #ffe85c;
  --auth-danger: #b4233c;
  --auth-success: #087a55;
  --auth-focus: 0 0 0 3px rgba(35, 76, 234, 0.3);
}

* { box-sizing: border-box; }

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--auth-canvas);
  color: var(--auth-ink);
  font-family: Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--auth-canvas);
}

button,
input { font: inherit; }

a { color: inherit; }

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: none;
  box-shadow: var(--auth-focus);
}

.auth-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding: 0 32px;
  border-bottom: 1px solid var(--auth-line);
  background: var(--auth-surface);
}

.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: inherit;
  font-weight: 800;
  letter-spacing: -0.04em;
  text-decoration: none;
}

.auth-brand-mark {
  position: relative;
  width: 31px;
  height: 31px;
  border-radius: 5px;
  background: var(--auth-primary) url("brand/makeloft-mark.svg") center / cover no-repeat;
}

.auth-brand-mark::after {
  display: none;
}

.auth-language {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--auth-line);
  border-radius: 4px;
  background: var(--auth-canvas);
}

.auth-language button {
  min-width: 42px;
  min-height: 44px;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: var(--auth-muted);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.auth-language button[aria-pressed="true"] {
  background: #eef2fe;
  color: var(--auth-primary);
}

.auth-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 480px);
  align-items: center;
  gap: clamp(48px, 8vw, 130px);
  width: min(1180px, calc(100% - 48px));
  min-height: calc(100vh - 72px);
  margin: 0 auto;
  padding: 56px 0;
}

.auth-intro { max-width: 600px; }

.auth-kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 20px;
  color: var(--auth-muted);
  font-family: monospace;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.auth-kicker::before {
  content: "";
  width: 25px;
  height: 9px;
  border: 1px solid var(--auth-primary);
  border-radius: 3px;
  background: var(--auth-signal);
}

.auth-intro h1 {
  margin: 0;
  max-width: 640px;
  font-family: inherit;
  font-size: clamp(46px, 6vw, 76px);
  line-height: 0.98;
  letter-spacing: -0.06em;
}

.auth-intro h1 span {
  color: var(--auth-primary);
}

.auth-intro > p:last-child {
  max-width: 500px;
  margin: 28px 0 0;
  color: var(--auth-muted);
  font-size: 17px;
  line-height: 1.7;
}

.auth-card {
  padding: 28px;
  border: 1px solid var(--auth-line);
  border-radius: 4px;
  background: var(--auth-surface);
}

.auth-card h2 {
  margin: 0 0 8px;
  font-family: inherit;
  font-size: 25px;
  letter-spacing: -0.03em;
}

.auth-card-copy {
  margin: 0 0 24px;
  color: var(--auth-muted);
  line-height: 1.6;
}

.auth-mode {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin-bottom: 20px;
  padding: 4px;
  border: 1px solid var(--auth-line);
  border-radius: 4px;
  background: var(--auth-canvas);
}

.auth-mode button {
  min-height: 42px;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: var(--auth-muted);
  font-weight: 700;
  cursor: pointer;
}

.auth-mode button[aria-pressed="true"] {
  background: var(--auth-primary);
  color: var(--auth-surface);
}

.auth-field { margin-bottom: 16px; }

.auth-field label {
  display: block;
  margin-bottom: 8px;
  color: var(--auth-ink);
  font-size: 13px;
  font-weight: 700;
}

.auth-field input {
  width: 100%;
  min-height: 50px;
  padding: 0 14px;
  border: 1px solid var(--auth-line);
  border-radius: 4px;
  background: var(--auth-surface);
  color: var(--auth-ink);
}

.auth-field input::placeholder { color: var(--auth-muted); }
.auth-field input:hover { border-color: var(--auth-primary); }

.auth-submit,
.auth-google {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 50px;
  border-radius: 4px;
  font-weight: 800;
  cursor: pointer;
}

.auth-submit {
  margin-top: 4px;
  border: 1px solid var(--auth-primary);
  background: var(--auth-primary);
  color: var(--auth-surface);
}

.auth-submit:hover { border-color: var(--auth-primary-hover); background: var(--auth-primary-hover); }
.auth-submit:disabled,
.auth-google:disabled { cursor: wait; opacity: 0.62; }

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: var(--auth-muted);
  font-family: monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--auth-line);
}

.auth-google {
  gap: 10px;
  border: 1px solid var(--auth-line);
  background: var(--auth-surface);
  color: var(--auth-ink);
}

.auth-google:hover { border-color: var(--auth-primary); background: var(--auth-surface-raised); }

.google-mark {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--auth-surface-raised);
  color: var(--auth-primary);
  font-family: Arial, sans-serif;
  font-size: 13px;
  font-weight: 800;
}

.auth-message {
  margin: 18px 0 0;
  padding: 12px 14px;
  border: 1px solid var(--auth-line);
  border-radius: 4px;
  color: var(--auth-muted);
  font-size: 13px;
  line-height: 1.5;
}

.auth-message[data-kind="error"] { border-color: #f3c4cd; background: #fff1f3; color: var(--auth-danger); }
.auth-message[data-kind="success"] { border-color: #b6dfcf; background: #edf9f3; color: var(--auth-success); }

.auth-note {
  margin: 20px 0 0;
  color: var(--auth-muted);
  font-size: 12px;
  line-height: 1.55;
  text-align: center;
}

.auth-links { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-top: 12px; }
.auth-links a, .auth-links button { display: inline-flex; align-items: center; min-height: 44px; padding: 0; border: 0; border-radius: 4px; background: transparent; color: var(--auth-primary); font-size: 13px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.auth-links [hidden] { display: none; }
.auth-recovery-card { width: min(460px, 100%); }
.auth-recovery-card h1 { margin: 0 0 20px; font-size: 26px; }

.callback-shell {
  display: grid;
  place-items: center;
  min-height: calc(100vh - 72px);
  padding: 32px 20px;
}

.callback-card {
  width: min(460px, 100%);
  padding: 36px;
  border: 1px solid var(--auth-line);
  border-radius: 4px;
  background: var(--auth-surface);
  text-align: center;
}

.callback-pulse {
  width: 48px;
  height: 48px;
  margin: 0 auto 24px;
  border: 1px solid var(--auth-primary);
  border-radius: 4px;
  background: var(--auth-primary);
  animation: auth-pulse 1.8s ease-in-out infinite;
}

.callback-card h1 {
  margin: 0 0 14px;
  font: 800 28px/1.15 Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  letter-spacing: -0.04em;
}

.callback-card .auth-message { text-align: left; }

.callback-login {
  display: inline-flex;
  margin-top: 20px;
  color: var(--auth-primary);
  font-weight: 700;
}

.callback-login[hidden] { display: none; }

@keyframes auth-pulse {
  50% { transform: scale(0.92); opacity: 0.75; }
}

@media (max-width: 820px) {
  .auth-topbar { padding: 0 20px; }
  .auth-shell {
    grid-template-columns: 1fr;
    gap: 34px;
    width: min(100% - 32px, 520px);
    padding: 36px 0 48px;
  }
  .auth-intro h1 { font-size: clamp(42px, 12vw, 62px); }
  .auth-intro > p:last-child { margin-top: 20px; }
}

@media (max-width: 480px) {
  .auth-topbar { min-height: 64px; padding: 0 16px; }
  .auth-shell { width: min(100% - 24px, 460px); min-height: calc(100vh - 64px); padding-top: 26px; }
  .auth-intro h1 { font-size: 42px; }
  .auth-card { padding: 20px; border-radius: 4px; }
  .callback-shell { min-height: calc(100vh - 64px); }
  .callback-card { padding: 28px 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .callback-pulse { animation: none; }
}
