:root {
  --paper: #f4f1e9;
  --ink: #111114;
  --mint: #3ef2bd;
  --heat: #ff3514;
  --muted: #6a6862;
  --rule: 3px solid var(--ink);
  --mono: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
  --display: Inter, "Noto Sans SC", "Microsoft YaHei", Arial, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }

html,
body { min-height: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--display);
  letter-spacing: 0;
}

button,
input {
  font: inherit;
  letter-spacing: 0;
}

.login-masthead {
  min-height: 84px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 4vw;
  border-top: 8px solid var(--mint);
  border-bottom: var(--rule);
}

.login-brand {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--mono);
  font-size: 26px;
  font-weight: 900;
}

.brand-mark {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  background: var(--heat);
}

.masthead-channel {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
}

.login-main {
  width: min(1180px, 92vw);
  min-height: 620px;
  margin: auto;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, .85fr);
  border: var(--rule);
}

.login-intro,
.login-panel {
  min-width: 0;
  padding: clamp(36px, 6vw, 80px);
}

.login-intro {
  display: flex;
  flex-direction: column;
  justify-content: center;
  color: var(--paper);
  background: var(--ink);
}

.intro-index,
.panel-heading,
.signal-line,
.login-footer {
  font-family: var(--mono);
  font-weight: 700;
}

.intro-index {
  margin-bottom: 28px;
  color: var(--mint);
  font-size: 12px;
}

h1 {
  max-width: 620px;
  margin: 0;
  font-size: clamp(44px, 6vw, 82px);
  line-height: 1.02;
  font-weight: 950;
}

.login-intro p {
  max-width: 500px;
  margin: 28px 0 0;
  font-size: 20px;
  line-height: 1.65;
  color: rgba(244, 241, 233, .72);
}

.signal-line {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 72px;
  color: var(--mint);
  font-size: 12px;
}

.signal-dot {
  width: 9px;
  height: 9px;
  background: var(--mint);
}

.login-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.panel-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 17px;
  border-bottom: var(--rule);
  font-size: 12px;
}

.panel-heading span:last-child {
  color: var(--heat);
  font-size: 10px;
}

form {
  display: grid;
  margin-top: 36px;
}

label {
  margin: 0 0 9px;
  font-size: 14px;
  font-weight: 800;
}

label:not(:first-child) { margin-top: 24px; }

input {
  width: 100%;
  min-height: 58px;
  padding: 13px 15px;
  border: 2px solid var(--ink);
  border-radius: 0;
  outline: none;
  color: var(--ink);
  background: #fff;
  font-family: var(--mono);
  font-size: 16px;
}

input:focus { box-shadow: 7px 7px 0 var(--mint); }

button {
  min-height: 60px;
  margin-top: 32px;
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 2px solid var(--ink);
  border-radius: 0;
  color: var(--paper);
  background: var(--ink);
  cursor: pointer;
  font-weight: 900;
}

button:hover {
  color: var(--ink);
  background: var(--mint);
}

button:focus-visible {
  outline: 3px solid var(--heat);
  outline-offset: 3px;
}

button:disabled {
  cursor: wait;
  opacity: .58;
}

.form-message {
  min-height: 24px;
  margin: 18px 0 0;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.6;
}

.form-message.error { color: #c4270d; }
.form-message.success { color: #087252; }

[hidden] { display: none !important; }
.auth-main { margin-block: 36px; }
.auth-main h1 { font-size: clamp(42px, 5vw, 70px); line-height: 1.15; }
.auth-main .login-panel { padding: clamp(28px, 4vw, 56px); }
.field-help { margin: 10px 0 0; color: var(--muted); font-size: 12px; line-height: 1.8; }
.auth-note { margin: 28px 0 0; line-height: 1.8; }
.auth-links { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--edge, var(--ink)); font-size: 13px; }
.auth-links a { color: var(--ink); text-underline-offset: 4px; }
.auth-links a:hover { color: var(--heat); }
.auth-links a:focus-visible, .auth-primary-link:focus-visible { outline: 3px solid var(--focus, var(--heat)); outline-offset: 5px; }
.auth-success { padding-top: 16px; }
.auth-success h2 { margin: 0 0 14px; font-size: 25px; }
.auth-success p { overflow-wrap: anywhere; line-height: 1.8; }
.auth-secondary, .auth-text-button { width: 100%; min-height: 46px; margin-top: 20px; justify-content: center; }
.login-panel .auth-secondary { color: var(--ink); background: transparent; border-color: var(--edge, var(--ink)); }
.login-panel .auth-secondary:hover { color: #111114; background: var(--mint); }
.login-panel .auth-text-button { min-height: 36px; margin-top: 6px; padding: 4px; color: var(--muted); background: transparent; border: 0; font-size: 13px; text-decoration: underline; text-underline-offset: 4px; }
.login-panel .auth-text-button:hover { color: var(--heat); background: transparent; }
.auth-primary-link { display: flex; min-height: 48px; align-items: center; justify-content: center; margin-top: 24px; color: #111114; background: var(--mint); border: 2px solid #111114; font-weight: 800; text-decoration: none; }
.login-panel form[aria-busy="true"] input { opacity: .7; }

.login-footer {
  min-height: 62px;
  padding: 0 4vw;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-top: var(--rule);
  color: var(--muted);
  font-size: 10px;
}

@media (max-width: 760px) {
  .login-masthead {
    min-height: 72px;
    padding: 0 18px;
  }

  .login-brand { font-size: 20px; }
  .masthead-channel { display: none; }

  .login-main {
    width: 100%;
    min-height: auto;
    margin: 0;
    grid-template-columns: 1fr;
    border: 0;
  }

  .auth-main { margin-block: 0; }
  .auth-main .login-intro { min-height: 240px; }
  .auth-main .login-panel { min-height: 380px; padding: 32px 22px; }

  .login-intro,
  .login-panel { padding: 38px 22px; }

  .login-intro {
    min-height: 300px;
    border-bottom: var(--rule);
  }

  h1 { font-size: 44px; }

  .login-intro p {
    margin-top: 18px;
    font-size: 17px;
  }

  .signal-line { margin-top: 38px; }
  .login-panel { min-height: 420px; }

  .login-footer {
    padding: 18px 22px;
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }
}
