:root {
  --bg: #ffffff;
  --panel: rgba(255, 253, 248, 0.9);
  --ink: #1d1c19;
  --muted: #615d56;
  --border: rgba(29, 28, 25, 0.1);
  --accent: #0f8b7a;
  --accent-strong: #0a6e61;
  --warm: #ef7d57;
  --shadow: 0 24px 80px rgba(33, 26, 11, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
  background: var(--bg);
  color: var(--ink);
  font-family: "IBM Plex Sans", sans-serif;
}

a,
button {
  color: inherit;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.auth-shell {
  width: min(400px, 100%);
}

.auth-card {
  padding: 24px;
}

.auth-card .brand {
  display: flex;
  width: fit-content;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 0 auto 20px;
}

.auth-card .brand-logo {
  display: block;
  margin: 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font-family: "Space Grotesk", sans-serif;
  font-size: 24px;
  font-weight: 700;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  color: white;
  background: linear-gradient(135deg, var(--accent), var(--warm));
}

.eyebrow {
  margin: 24px 0 10px;
  color: var(--accent-strong);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 700;
}

h1,
h2 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  letter-spacing: -0.05em;
}

h1 {
  font-size: clamp(34px, 6vw, 56px);
  line-height: 0.98;
}

.subcopy {
  color: var(--muted);
  line-height: 1.7;
}

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

label {
  display: grid;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
}

input {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.74);
  color: var(--ink);
}

.form-message {
  margin: 0;
  color: #cc5333;
  font-size: 14px;
  line-height: 1.5;
}

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

.primary-button,
.ghost-link {
  min-height: 46px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.full-width-button {
  width: 100%;
}

.primary-button {
  background: var(--ink);
  color: white;
  border-color: transparent;
}

.primary-button:disabled,
.ghost-link:disabled {
  cursor: wait;
  opacity: 0.78;
}

.button-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: currentColor;
  border-radius: 999px;
  animation: button-spin 0.8s linear infinite;
}

.button-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.ghost-link {
  background: rgba(255, 255, 255, 0.58);
}

.auth-divider {
  position: relative;
  margin: 18px 0;
  text-align: center;
}

.auth-divider::before {
  content: "";
  position: absolute;
  inset: 50% 0 auto;
  border-top: 1px solid var(--border);
}

.auth-divider span {
  position: relative;
  z-index: 1;
  display: inline-block;
  padding: 0 12px;
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.text-action {
  min-height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: #2d6cdf;
  font-size: 14px;
  font-weight: 600;
}

.inline-link {
  justify-self: end;
  text-decoration: none;
}

.text-action:disabled {
  cursor: default;
  opacity: 1;
  color: rgba(45, 108, 223, 0.55);
}

.inline-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.auth-stack {
  display: grid;
  gap: 14px;
}

.turnstile-wrap {
  display: flex;
  justify-content: center;
}

.consent-check {
  display: grid;
  grid-template-columns: 18px 1fr;
  align-items: start;
  gap: 10px;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  line-height: 1.5;
}

.consent-check input {
  width: 18px;
  height: 18px;
  min-height: 18px;
  margin: 2px 0 0;
  padding: 0;
  accent-color: var(--ink);
}

.consent-check span {
  display: block;
}

.consent-check a {
  color: #2d6cdf;
  font-weight: 600;
}

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

body.theme-dark {
  --bg: #121314;
  --panel: rgba(24, 27, 29, 0.9);
  --ink: #f2eee8;
  --muted: #aea79d;
  --border: rgba(242, 238, 232, 0.12);
  --accent: #7da2ff;
  --accent-strong: #9dbaff;
  --warm: #ff9b78;
  --shadow: 0 30px 90px rgba(0, 0, 0, 0.35);
}

body.theme-dark input {
  background: rgba(255, 255, 255, 0.06);
}

body.theme-dark .primary-button {
  background: var(--ink);
  color: var(--bg);
}

body.theme-dark .ghost-link {
  background: rgba(255, 255, 255, 0.08);
}

body.theme-dark .text-action {
  color: #7da2ff;
}

body.theme-dark .text-action:disabled {
  color: rgba(125, 162, 255, 0.55);
}

body.theme-dark .consent-check a {
  color: #7da2ff;
}


.password-toggle {
  position: absolute;
  right: 0;
  top: 55%;
  display: flex;
  align-items: center;
  padding: 0 10px;
  background: none;
  border: none;
  cursor: pointer;
  color: #6b7280;
  font-size: 13px;
  font-weight: 500;
  z-index: 1;
}

.password-toggle:hover {
  color: #374151;
}

body.theme-dark .password-toggle {
  color: #9ca3af;
}

body.theme-dark .password-toggle:hover {
  color: #e5e7eb;
}