:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --panel: #ffffff;
  --panel-soft: #f9fafb;
  --text: #182230;
  --muted: #667085;
  --line: #e4e7ec;
  --line-strong: #d0d5dd;
  --brand: #2563eb;
  --brand-dark: #174ea6;
  --danger: #b42318;
  --success: #067647;
  --shadow: 0 18px 44px rgba(16, 24, 40, 0.08);
  font-family: Inter, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 18% 12%, rgba(37, 99, 235, 0.08), transparent 28%),
    linear-gradient(135deg, #ffffff 0%, var(--bg) 46%, #eef5ff 100%);
  color: var(--text);
}

button,
input {
  font: inherit;
}

.login-shell {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(360px, 460px);
  align-items: center;
  gap: 56px;
  min-height: 100vh;
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 40px 0;
}

.login-brand {
  display: grid;
  gap: 72px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  width: fit-content;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: var(--brand);
  color: #ffffff;
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
}

.brand-copy h1 {
  margin: 0;
  font-size: clamp(34px, 5vw, 56px);
  line-height: 1.08;
  letter-spacing: 0;
}

.brand-copy p {
  max-width: 520px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
}

.login-panel {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(228, 231, 236, 0.9);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 28px;
}

.panel-head span {
  color: var(--brand);
  font-size: 13px;
  font-weight: 700;
}

.panel-head h2 {
  margin: 8px 0 0;
  font-size: 28px;
  letter-spacing: 0;
}

.panel-head p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin: 24px 0 18px;
  padding: 4px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.tabs button {
  min-height: 38px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #475467;
  cursor: pointer;
  font-weight: 650;
}

.tabs button.active {
  background: #ffffff;
  color: var(--brand);
  box-shadow: 0 1px 4px rgba(16, 24, 40, 0.08);
}

.auth-form,
.reset-form {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 7px;
}

label span {
  color: #344054;
  font-size: 13px;
  font-weight: 650;
}

input {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  outline: 0;
}

input:focus {
  border-color: rgba(37, 99, 235, 0.58);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.code-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px;
  align-items: end;
  gap: 10px;
}

.primary-button,
.ghost-button,
.link-button {
  min-height: 42px;
  border-radius: 8px;
  cursor: pointer;
}

.primary-button {
  border: 0;
  background: var(--brand);
  color: #ffffff;
  font-weight: 750;
}

.primary-button:hover {
  background: var(--brand-dark);
}

.ghost-button {
  border: 1px solid var(--line-strong);
  background: #ffffff;
  color: #344054;
  font-weight: 650;
}

.ghost-button:disabled,
.primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.link-button {
  border: 0;
  background: transparent;
  color: var(--brand);
  font-weight: 650;
}

.reset-form {
  margin-top: 16px;
  padding: 16px;
  background: #f8fbff;
  border: 1px solid #dbeafe;
  border-radius: 8px;
}

.reset-head strong,
.reset-head span {
  display: block;
}

.reset-head span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.message {
  min-height: 22px;
  margin-top: 16px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.message.error {
  color: var(--danger);
}

.message.success {
  color: var(--success);
}

.hidden {
  display: none !important;
}

@media (max-width: 860px) {
  .login-shell {
    grid-template-columns: 1fr;
    gap: 28px;
    width: min(520px, calc(100% - 28px));
  }

  .login-brand {
    gap: 34px;
  }

  .login-panel {
    padding: 22px;
  }
}

@media (max-width: 460px) {
  .code-row {
    grid-template-columns: 1fr;
  }
}
