:root {
  --bg: #f5f5f7;
  --card: #ffffff;
  --text: #1d1d1f;
  --text-secondary: #86868b;
  --border: #d2d2d7;
  --accent: #0071e3;
  --accent-hover: #0077ed;
  --radius: 18px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
    sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
}

.page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.25rem;
}

.page--compact {
  align-items: flex-start;
  padding-top: 4rem;
}

.card {
  width: 100%;
  max-width: 400px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2.5rem 2rem 2rem;
}

.card--plain {
  box-shadow: var(--shadow);
}

.brand {
  text-align: center;
  margin-bottom: 2rem;
}

.brand-mark {
  width: 48px;
  height: 48px;
  margin: 0 auto 1rem;
  border-radius: 12px;
  background: linear-gradient(145deg, #0071e3 0%, #42a1ff 100%);
  box-shadow: 0 8px 20px rgba(0, 113, 227, 0.25);
}

.title {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 0.35rem;
}

.title--left {
  text-align: left;
}

.subtitle {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--text-secondary);
  font-weight: 400;
}

.subtitle--left {
  text-align: left;
}

.alert {
  font-size: 0.875rem;
  color: #c41e3a;
  background: rgba(196, 30, 58, 0.06);
  border-radius: 10px;
  padding: 0.65rem 0.85rem;
  margin-bottom: 1.25rem;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.field input {
  width: 100%;
  padding: 0.75rem 0.9rem;
  font-size: 1rem;
  font-family: inherit;
  color: var(--text);
  background: #fafafa;
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.field input::placeholder {
  color: #aeaeb2;
}

.field input:hover {
  background: #fff;
}

.field input:focus {
  background: #fff;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.15);
}

.captcha-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.75rem;
  align-items: end;
}

.captcha-field {
  min-width: 0;
}

.captcha-box {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding-bottom: 0.05rem;
}

.captcha-box img {
  display: block;
  border-radius: 10px;
  border: 1px solid var(--border);
  cursor: pointer;
  background: #fafafa;
}

.refresh {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fafafa;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.refresh:hover {
  background: #fff;
  color: var(--accent);
  border-color: var(--accent);
}

.submit {
  margin-top: 0.5rem;
  width: 100%;
  padding: 0.85rem 1rem;
  font-size: 1rem;
  font-weight: 500;
  font-family: inherit;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: 980px;
  cursor: pointer;
  letter-spacing: 0.01em;
  transition: background 0.15s ease, transform 0.1s ease;
}

.submit:hover {
  background: var(--accent-hover);
}

.submit:active {
  transform: scale(0.99);
}

.footnote {
  margin: 1.75rem 0 0;
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.link {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.9375rem;
}

.link:hover {
  text-decoration: underline;
}

@media (max-width: 420px) {
  .captcha-row {
    grid-template-columns: 1fr;
  }

  .captcha-box {
    justify-content: flex-start;
  }
}
