:root {
  --ink: #f2f5f1;
  --muted: #9ca59e;
  --dim: #69716b;
  --base: #0b0d0c;
  --surface: #151916;
  --line: rgba(226, 237, 229, 0.12);
  --line-strong: rgba(226, 237, 229, 0.22);
  --accent: #a875f5;
  --accent-ink: #211145;
  --accent-blue: #66a1f9;
  --accent-pink: #e87ebe;
  --error: #ff9a9a;
  --success: #9ee6bf;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  display: flex;
  min-height: 100vh;
  min-height: 100dvh;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 2rem 1rem;
  color: var(--ink);
  background: var(--base);
  font-family: var(--font);
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.skip-link {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 20;
  transform: translateY(-180%);
  border: 1px solid var(--line-strong);
  border-radius: 0.5rem;
  background: var(--ink);
  padding: 0.6rem 0.85rem;
  color: var(--base);
  text-decoration: none;
  transition: transform 180ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.portal-shell {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 24rem;
}

.card {
  position: relative;
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: var(--surface);
  padding: 2rem;
  text-align: center;
}

.card::before {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  content: "";
  background: linear-gradient(90deg, var(--accent-blue), var(--accent), var(--accent-pink));
}

.card-logo {
  display: block;
  margin: 0 auto 1rem;
  border-radius: 0.7rem;
}

.card-title {
  margin: 0 0 0.3rem;
  font-size: 1.3rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.card-subtitle {
  margin: 0 0 1.4rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.card-subtitle strong {
  color: var(--ink);
  font-weight: 600;
}

.card-switch {
  margin: 0 0 1.5rem;
  padding-bottom: 1.4rem;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.82rem;
}

.card-switch a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 0.2rem;
}

.register-form {
  display: grid;
  gap: 1rem;
  text-align: left;
}

.field-group {
  display: grid;
  gap: 0.4rem;
}

.field-group label {
  color: #d3d9d5;
  font-size: 0.78rem;
  font-weight: 600;
}

.field-group small {
  color: var(--dim);
  font-size: 0.68rem;
  line-height: 1.5;
}

.address-field,
.password-field {
  display: flex;
  align-items: center;
  min-height: 2.75rem;
  border: 1px solid var(--line);
  border-radius: 0.55rem;
  background: rgba(255, 255, 255, 0.03);
  transition: border-color 150ms ease;
}

.address-field:focus-within,
.password-field:focus-within {
  border-color: rgba(168, 117, 245, 0.5);
}

.address-field input,
.password-field input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  padding: 0 0.8rem;
  color: var(--ink);
  font-size: 0.88rem;
}

input::placeholder {
  color: #555e57;
}

.address-field > span {
  flex: 0 0 auto;
  border-left: 1px solid var(--line);
  padding: 0.2rem 0.8rem;
  color: var(--muted);
  font-size: 0.78rem;
}

.reveal-button {
  align-self: stretch;
  border: 0;
  border-left: 1px solid var(--line);
  background: transparent;
  padding: 0 0.75rem;
  color: var(--dim);
  font-size: 0.68rem;
  cursor: pointer;
}

.reveal-button:hover {
  color: var(--ink);
}

.turnstile-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 4rem;
  overflow: hidden;
  border-radius: 0.55rem;
}

.turnstile-missing {
  border: 1px solid rgba(255, 154, 154, 0.2);
  border-radius: 0.55rem;
  background: rgba(255, 154, 154, 0.05);
  padding: 0.75rem;
  color: var(--error);
  font-size: 0.75rem;
}

.form-message {
  display: none;
  margin: 0;
  border-radius: 0.55rem;
  padding: 0.7rem 0.85rem;
  font-size: 0.74rem;
  line-height: 1.5;
}

.form-message:not(:empty) {
  display: block;
}

.form-message a {
  color: var(--ink);
  text-underline-offset: 0.2rem;
}

.form-message.error {
  border: 1px solid rgba(255, 154, 154, 0.18);
  background: rgba(255, 154, 154, 0.05);
  color: var(--error);
}

.form-message.success {
  border: 1px solid rgba(158, 230, 191, 0.2);
  background: rgba(158, 230, 191, 0.06);
  color: var(--success);
}

.submit-button {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 2.85rem;
  border: 0;
  border-radius: 0.55rem;
  background: var(--ink);
  color: #101310;
  font-size: 0.86rem;
  font-weight: 650;
  cursor: pointer;
  transition: opacity 150ms ease;
}

.submit-button:hover:not(:disabled) {
  opacity: 0.9;
}

.submit-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.card-footnote {
  margin: 1.2rem 0 0;
  color: var(--dim);
  font-size: 0.68rem;
  line-height: 1.5;
}

.site-footer {
  margin: 1.5rem 0 0;
  color: var(--dim);
  font-size: 0.72rem;
}

.site-footer a {
  color: var(--dim);
  text-underline-offset: 0.2rem;
}

.site-footer a:hover {
  color: var(--muted);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}
