:root {
  color-scheme: light;
  --bg: #eef4f8;
  --panel: #ffffff;
  --ink: #13202f;
  --muted: #5d6b7c;
  --line: #d7e0e8;
  --brand: #0f766e;
  --brand-dark: #115e59;
  --blue: #1d4ed8;
  --danger: #b42318;
  --danger-bg: #fff1f0;
  --ok: #047857;
  --ok-bg: #ecfdf5;
  --shadow: 0 24px 72px rgba(25, 43, 67, 0.13);
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  font-family: "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
  background:
    linear-gradient(90deg, rgba(15, 118, 110, 0.06) 1px, transparent 1px),
    linear-gradient(0deg, rgba(29, 78, 216, 0.06) 1px, transparent 1px),
    var(--bg);
  background-size: 44px 44px;
  color: var(--ink);
}

button,
input {
  font: inherit;
}

a {
  color: var(--blue);
}

.page-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
}

.brand-panel {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 32px;
  padding: 42px clamp(28px, 5vw, 72px);
  background: #0f172a;
  color: #f8fafc;
}

.brand-logo {
  letter-spacing: 0.08em;
  font-weight: 800;
  font-size: 22px;
}

.brand-copy {
  max-width: 620px;
}

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

.brand-copy p {
  margin: 20px 0 0;
  max-width: 560px;
  color: #cbd5e1;
  line-height: 1.8;
  font-size: 16px;
}

.visual-card {
  margin-top: 34px;
  max-width: 620px;
  border: 1px solid rgba(226, 232, 240, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.visual-card img {
  display: block;
  width: 100%;
  height: auto;
}

.brand-foot {
  color: #94a3b8;
  font-size: 12px;
}

.login-panel {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}

.login-card,
.status-card {
  width: min(100%, 420px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.login-card {
  padding: 30px;
}

.mobile-logo {
  display: none;
  margin-bottom: 20px;
  letter-spacing: 0.08em;
  font-weight: 800;
  font-size: 22px;
}

.login-card h2,
.status-card h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.25;
}

.login-card .sub,
.status-card p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.65;
  font-size: 14px;
}

.form {
  margin-top: 24px;
  display: grid;
  gap: 15px;
}

.field label {
  display: block;
  margin-bottom: 7px;
  color: #334155;
  font-size: 13px;
  font-weight: 700;
}

.input {
  width: 100%;
  min-height: 44px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--ink);
  background: #ffffff;
  outline: none;
}

.input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.14);
}

.primary-button,
.oauth-button,
.secondary-button {
  width: 100%;
  min-height: 44px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 800;
}

.primary-button {
  color: #ffffff;
  background: var(--brand);
}

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

.primary-button:disabled,
.oauth-button:disabled,
.secondary-button:disabled {
  cursor: not-allowed;
  opacity: 0.66;
}

.divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  margin: 22px 0;
  color: #789;
  font-size: 12px;
}

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

.oauth-group {
  display: grid;
  gap: 10px;
}

.oauth-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  background: #ffffff;
  border-color: #cbd5e1;
  color: #182333;
}

.oauth-button:hover,
.secondary-button:hover {
  background: #f8fafc;
}

.oauth-button.github {
  background: #24292f;
  border-color: #24292f;
  color: #ffffff;
}

.oauth-button.github:hover {
  background: #111827;
}

.button-row {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

.small-link {
  display: inline-flex;
  margin-top: 16px;
  font-size: 13px;
}

.alert {
  margin-top: 16px;
  border-radius: 8px;
  padding: 11px 12px;
  font-size: 13px;
  line-height: 1.55;
}

.alert.error {
  border: 1px solid #fecaca;
  color: var(--danger);
  background: var(--danger-bg);
}

.alert.ok {
  border: 1px solid #bbf7d0;
  color: var(--ok);
  background: var(--ok-bg);
}

.center-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
}

.status-card {
  padding: 30px;
  text-align: center;
}

.spinner {
  width: 34px;
  height: 34px;
  margin: 0 auto 18px;
  border: 3px solid #d7e0e8;
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 860px) {
  .page-shell {
    display: block;
  }

  .brand-panel {
    display: none;
  }

  .login-panel {
    min-height: 100vh;
  }

  .mobile-logo {
    display: block;
    text-align: center;
  }
}

@media (max-width: 460px) {
  .login-panel,
  .center-shell {
    padding: 18px;
  }

  .login-card,
  .status-card {
    padding: 22px;
  }

  .button-row {
    display: grid;
  }
}
