:root {
  --bg: #f8f7f4;
  --paper: #fffdf9;
  --ink: #191613;
  --muted: #6f6a63;
  --line: #d9d5ce;
  --blue: #82b7ff;
  --blue-soft: #e6f1ff;
  --blue-text: #0b63ce;
  --shadow: 0 18px 54px rgba(44, 36, 26, 0.12);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--bg);
  font-family:
    ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Helvetica Neue", Arial, "Microsoft YaHei", sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

.login-header {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 10;
  width: 100%;
  padding: 28px 7vw;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: Georgia, "Times New Roman", "Songti SC", serif;
  font-size: 28px;
  font-weight: 700;
}

.brand-mark {
  width: 26px;
  height: 26px;
  display: block;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 96px 22px 48px;
}

.login-column {
  width: min(100%, 520px);
}

.login-copy {
  margin-bottom: 34px;
  text-align: center;
}

h1 {
  margin: 0 0 18px;
  font-family: Georgia, "Times New Roman", "Songti SC", serif;
  font-size: clamp(54px, 7vw, 72px);
  font-weight: 500;
  line-height: 0.96;
  letter-spacing: 0;
}

.login-copy p {
  max-width: 450px;
  margin: 0 auto;
  font-family: Georgia, "Times New Roman", "Songti SC", serif;
  font-size: 21px;
  line-height: 1.18;
  color: #080605;
}

.auth-shell {
  overflow: hidden;
  border: 1px solid var(--blue);
  border-radius: 26px;
  background: var(--blue-soft);
  box-shadow: var(--shadow);
}

.auth-banner {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--blue-text);
  font-size: 14px;
}

.auth-banner span {
  padding: 2px 9px;
  background: #cfe4ff;
  border-radius: 6px;
  font-weight: 700;
}

.login-card {
  padding: 28px;
  background: rgba(255, 253, 249, 0.98);
  border-top: 1px solid var(--line);
  border-radius: 26px 26px 0 0;
}

.auth-step,
.email-form,
.code-form,
.password-form {
  display: grid;
  gap: 14px;
}

.auth-step[hidden],
.code-form[hidden],
.password-form[hidden] {
  display: none !important;
}

.auth-step h2 {
  margin: 0;
  font-size: 23px;
  font-weight: 700;
  letter-spacing: 0;
  text-align: center;
}

.step-copy {
  margin: -4px 0 2px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
  text-align: center;
}

.email-form input,
.code-form input,
.password-form input {
  width: 100%;
  min-height: 52px;
  padding: 0 14px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid #bbb7b0;
  border-radius: 8px;
  outline: none;
  font-size: 16px;
}

.email-form input:focus,
.code-form input:focus,
.password-form input:focus {
  border-color: var(--ink);
  box-shadow: 0 0 0 2px rgba(25, 22, 19, 0.1);
}

.email-button,
.provider-button {
  width: 100%;
  min-height: 52px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 750;
}

.email-button {
  color: var(--paper);
  background: var(--ink);
  border: 1px solid var(--ink);
}

.email-button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.provider-button {
  display: grid;
  grid-template-columns: 34px 1fr 34px;
  align-items: center;
  padding: 0 16px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid #bbb7b0;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    transform 160ms ease;
}

.provider-button:hover {
  background: #f5f1ea;
  border-color: var(--ink);
  transform: translateY(-1px);
}

.provider-button span:nth-child(2) {
  text-align: center;
}

.provider-icon {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: #4285f4;
  font-size: 12px;
  font-weight: 800;
}

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 3px 0;
  color: var(--ink);
  font-size: 12px;
}

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

.text-button {
  min-height: 32px;
  color: var(--muted);
  background: transparent;
  border: 0;
  cursor: pointer;
  font-size: 14px;
}

.login-error,
.login-success {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.45;
}

.login-error {
  color: #8d2718;
  background: #fff1eb;
  border: 1px solid #efc7b7;
}

.login-success {
  color: #1e5a35;
  background: #eef8f0;
  border: 1px solid #bee4c8;
}

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

@media (max-width: 560px) {
  .login-header {
    position: static;
    padding: 24px 22px 0;
  }

  .login-page {
    align-items: start;
    padding-top: 54px;
  }

  .brand {
    font-size: 23px;
  }

  h1 {
    font-size: 44px;
  }

  .login-copy p {
    font-size: 17px;
  }

  .login-card {
    padding: 20px;
  }
}
