/* Auth pages — onboarding, login, OAuth callback. Tokens come from shared.css.
   Spacing variable names there are --s1..--s8 (not --space-N). Card uses
   8px radius vs the dashboard's 4px because auth is a single-moment surface
   that benefits from a slightly more deliberate, "stop and read" presence. */

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: var(--page-bg);
  padding: var(--s4);
}

.auth-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s4);
  width: 100%;
  max-width: 440px;
}

.auth-step-dots {
  display: flex;
  gap: 8px;
}

.auth-step-dot {
  width: 6px;
  height: 6px;
  border-radius: 9999px;
  background: var(--neutral-200);
  transition: background 220ms ease, transform 220ms ease, opacity 220ms ease;
}

.auth-step-dot[data-active="true"] {
  background: var(--accent);
  transform: scale(1.25);
}

.auth-step-dot[data-complete="true"] {
  background: var(--accent);
  opacity: 0.35;
}

html.dark .auth-step-dot {
  background: rgba(255, 255, 255, 0.16);
}

.auth-card {
  width: 100%;
  background: #ffffff;
  border-radius: 8px;
  border: 1px solid rgba(15, 18, 35, 0.06);
  box-shadow:
    0 1px 2px rgba(15, 18, 35, 0.04),
    0 12px 32px rgba(15, 18, 35, 0.06);
  padding: 40px 36px;
  display: flex;
  flex-direction: column;
}

html.dark .auth-card {
  background: var(--surface-bg);
  border-color: rgba(255, 255, 255, 0.06);
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.4),
    0 12px 32px rgba(0, 0, 0, 0.3);
}

.auth-step {
  display: flex;
  flex-direction: column;
}
.auth-step[hidden] { display: none; }

.auth-heading {
  font-family: 'Host Grotesk', 'DM Sans', system-ui, sans-serif;
  font-size: 26px;
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1.15;
  color: var(--text-primary);
  margin: 0 0 8px;
}

.auth-subhead {
  font-size: 14px;
  font-weight: 400;
  color: var(--text-secondary);
  line-height: 1.55;
  margin: 0 0 var(--s4);
}

.auth-fields {
  display: flex;
  flex-direction: column;
  gap: var(--s2);
}

.auth-row {
  display: flex;
  gap: 12px;
}
.auth-row > * { flex: 1; min-width: 0; }

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auth-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}

.auth-input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--border-default);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background: #ffffff;
  color: var(--text-primary);
  outline: none;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.auth-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(68, 84, 225, 0.14);
}
.auth-input::placeholder {
  color: var(--text-tertiary);
}
.auth-input.has-error {
  border-color: var(--negative);
  box-shadow: 0 0 0 3px rgba(255, 96, 92, 0.12);
}
.auth-input--code {
  font-family: 'SF Mono', Menlo, monospace;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 14px;
}

html.dark .auth-input {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.10);
}

.auth-error {
  font-size: 12px;
  color: var(--negative);
  margin: 4px 0 0;
  line-height: 1.4;
}

.auth-cta {
  height: 44px;
  margin-top: var(--s3);
  padding: 0 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 120ms ease, opacity 120ms ease, transform 120ms ease;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 1px 2px rgba(68, 84, 225, 0.2);
}
.auth-cta:hover:not(:disabled) {
  background: var(--accent-hover);
}
.auth-cta:active:not(:disabled) {
  transform: translateY(1px);
}
.auth-cta:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
}

.auth-cta--secondary {
  background: #ffffff;
  color: var(--text-primary);
  border: 1px solid var(--border-default);
  box-shadow: none;
  margin-top: 0;
}
.auth-cta--secondary:hover:not(:disabled) {
  background: var(--neutral-100);
  border-color: var(--neutral-300);
}

html.dark .auth-cta--secondary {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.12);
}
html.dark .auth-cta--secondary:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.08);
}

.auth-cta--google {
  background: #ffffff;
  color: var(--text-primary);
  border: 1px solid var(--border-default);
  box-shadow: none;
  margin-top: 0;
  position: relative;
}
.auth-cta--google img {
  width: 16px;
  height: 16px;
}
.auth-cta--google:hover:not(:disabled) {
  background: var(--neutral-100);
}
html.dark .auth-cta--google {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.12);
}
html.dark .auth-cta--google:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.08);
}

.auth-google--coming-soon {
  pointer-events: none;
}
.auth-google--coming-soon img { opacity: 0.45; }
.auth-google--coming-soon > span:not([class]) { opacity: 0.6; }
.auth-google--coming-soon::after {
  content: "Coming soon";
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  font-weight: 500;
  color: var(--text-tertiary);
  background: var(--neutral-100);
  padding: 3px 8px;
  border-radius: 9999px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
html.dark .auth-google--coming-soon::after {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-tertiary);
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 10px;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.10em;
  font-weight: 500;
  margin: var(--s3) 0;
}
.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border-default);
}

.auth-foot {
  margin-top: var(--s3);
  font-size: 13px;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.5;
}
.auth-foot + .auth-foot {
  margin-top: 6px;
}
.auth-foot a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}
.auth-foot a:hover {
  text-decoration: underline;
}

.auth-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
}
.auth-loading[hidden] { display: none; }
.auth-loading .scan-loader {
  --scan-size: 32px;
  color: var(--accent);
}

@media (max-width: 520px) {
  .auth-card { padding: 32px 24px; }
  .auth-stack { gap: var(--s3); }
}
