:root {
  color-scheme: dark;
}

body.auth-page {
  margin: 0;
  min-height: 100vh;
  background: #000000;
  color: #f6f7fb;
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --ds-color-border: var(--panel-border);
  --ds-color-border-strong: var(--panel-border-strong);
  --ds-panel-bg-primary: var(--panel-bg-primary);
  --ds-panel-border: var(--panel-border);
  --ds-panel-border-strong: var(--panel-border-strong);
  --ds-panel-shadow: var(--panel-shadow);
  --ds-panel-inset: var(--panel-inset);
  --ds-color-text: #ffffff;
  --ds-color-text-muted: rgba(255, 255, 255, 0.72);
  --ds-color-text-faint: rgba(255, 255, 255, 0.48);
  --ds-color-accent: #32c5fd;
  --ds-color-danger: #eb5757;
  --ds-radius-sm: 8px;
  --ds-radius-md: 12px;
  --ds-radius-lg: 14px;
}

.auth-page .auth-overlay {
  position: relative;
  inset: auto;
  min-height: 100vh;
  background: transparent;
  backdrop-filter: none;
  padding: 40px 16px;
  box-sizing: border-box;
}

.auth-page .auth-card {
  width: min(460px, 100%);
  grid-template-columns: 1fr;
  background: #11171f;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  box-shadow: none;
}

.auth-page .auth-logo {
  width: auto;
  height: 16px;
  display: block;
}

.auth-page .auth-panel {
  gap: 24px;
  padding: 32px;
  background: transparent;
}

.auth-page .auth-card.auth-card-single .auth-panel {
  padding: 32px;
}

.auth-page .auth-brand-panel {
  margin-bottom: 36px;
}

.auth-page .auth-panel-header {
  gap: 0;
}

.auth-page .auth-title {
  margin: 0;
  font-size: 26px;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.05;
  color: var(--ds-color-text);
}

.auth-page .auth-subtitle {
  margin-top: 10px;
  font-size: 14px;
  line-height: 1.45;
  color: var(--ds-color-text-muted);
}

.auth-page .auth-tab {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: auto;
  padding: 0;
  font-size: 14px;
  background: transparent;
  border: 0;
  color: var(--ds-color-accent);
  opacity: 1;
  transition:
    opacity 0.18s ease,
    background 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease;
}

.auth-page .auth-tab.is-active {
  display: none;
}

.auth-page .auth-tab:not(.is-active):hover,
.auth-page .auth-tab:not(.is-active):focus-visible {
  background: transparent;
  text-decoration: none;
}

.auth-page .auth-tab:not(.is-active):focus-visible {
  outline: 2px solid rgba(50, 197, 253, 0.72);
  outline-offset: 4px;
  border-radius: 3px;
}

.auth-page .auth-tab [data-auth-switch-action] {
  color: var(--ds-color-accent);
}

.auth-page .auth-tab:not(.is-active):hover [data-auth-switch-action],
.auth-page .auth-tab:not(.is-active):focus-visible [data-auth-switch-action] {
  color: #76dcff;
}

.auth-page .auth-tabs {
  justify-content: flex-start;
}

.auth-page .auth-tabs-inline {
  margin-top: 0;
  justify-content: flex-start;
  text-align: left;
}

.auth-page .auth-switch-prompt {
  color: var(--ds-color-text-muted);
}

.auth-page .auth-field label {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.56);
}

.auth-page .auth-field input {
  width: 100%;
  min-width: 0;
  height: 40px;
  min-height: 40px;
  box-sizing: border-box;
  font-size: 14px;
  padding: 0 12px;
  background: #1a1d24;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--ds-radius-sm);
  color: var(--ds-color-text);
}

.auth-page .auth-field input::placeholder {
  color: rgba(255, 255, 255, 0.36);
}

.auth-page .auth-field input:hover {
  border-color: rgba(255, 255, 255, 0.14);
}

.auth-page .auth-field input:focus-visible {
  outline: 2px solid rgba(50, 197, 253, 0.45);
  outline-offset: 0;
  border-color: transparent;
}

.auth-page .auth-link {
  font-size: 12px;
  line-height: 1.4;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.72);
}

.auth-page .auth-note {
  font-size: 14px;
  line-height: 1.5;
  color: var(--ds-color-danger);
}

.auth-page .auth-note.is-success {
  color: #5fe38c;
}

.auth-page .auth-note.is-error {
  color: var(--ds-color-danger);
}

.auth-page .auth-honeypot {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
}

.auth-page .auth-turnstile {
  min-height: 0;
}

.auth-page .auth-turnstile:not([hidden]) {
  min-height: 65px;
}

.auth-page .auth-remember {
  font-size: 13px;
  color: var(--ds-color-text-muted);
}

.auth-page .auth-provider-note {
  display: none;
}

.auth-page .auth-provider {
  justify-content: center;
  white-space: nowrap;
  background: #1a1d24;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #ffffff;
  min-height: 40px;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
}

.auth-page .auth-provider:hover {
  background: #232a33;
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: none;
}

.auth-page .auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.48);
}

.auth-page .auth-divider::before,
.auth-page .auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.14);
}

.auth-page .project-button.primary {
  background: #32c5fd;
  color: #0d0d0d;
  border: 0;
  border-radius: 8px;
  padding: 0 16px;
  font-weight: 700;
  box-shadow: none;
}

.auth-page .auth-submit {
  height: 40px;
  min-height: 40px;
  padding: 0 16px;
  font-size: 14px;
  width: 100%;
  min-width: 190px;
  justify-content: center;
}

.auth-page [hidden] {
  display: none !important;
}

.auth-page .auth-body {
  gap: 24px;
}

.auth-page .auth-form {
  gap: 16px;
}

.auth-page #auth-register-form {
  gap: 24px;
}

.auth-page .auth-register-fields {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-page .auth-register-cta {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-page .auth-field {
  gap: 6px;
}

.auth-page .auth-name-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.auth-page .auth-providers {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.auth-page .auth-divider.is-hidden,
.auth-page .auth-providers.is-hidden {
  display: none;
}

.auth-page .auth-input-row {
  position: relative;
  display: block;
}

.auth-page .auth-input-row input {
  width: 100%;
  padding-right: 52px;
}

.auth-page #auth-register-form .auth-input-row input {
  padding-right: 12px;
}

.auth-page .auth-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  width: auto;
  height: auto;
  padding: 4px 6px;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: var(--ds-color-accent);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.auth-page .auth-toggle:hover,
.auth-page .auth-toggle:focus-visible {
  color: var(--ds-color-accent);
  background: rgba(50, 197, 253, 0.1);
  outline: 2px solid rgba(50, 197, 253, 0.34);
}

.auth-page .auth-password-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.auth-page .auth-password-header .auth-toggle {
  position: static;
  transform: none;
  padding: 0;
}

.auth-page .auth-hint {
  font-size: 12px;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.48);
}

.auth-page .auth-hint.is-invalid {
  color: #eb5757;
}

.auth-page .auth-consents {
  display: grid;
  gap: 12px;
  padding: 0;
}

.auth-page .auth-checkbox {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 14px;
  line-height: 1.45;
  cursor: pointer;
}

.auth-page .auth-checkbox input {
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  accent-color: var(--ds-color-accent);
  cursor: pointer;
}

.auth-page .auth-checkbox input:focus-visible {
  outline: 2px solid rgba(50, 197, 253, 0.45);
  outline-offset: 2px;
}

.auth-page .auth-checkbox a {
  color: var(--ds-color-accent);
}

.auth-page .auth-optional {
  color: rgba(255, 255, 255, 0.48);
}

.auth-page .auth-consent-copy {
  margin: 0;
  color: rgba(255, 255, 255, 0.48);
  font-size: 12px;
  line-height: 1.5;
  text-wrap: pretty;
}

.auth-page .auth-consent-copy a {
  color: var(--ds-color-accent);
}

.auth-page .auth-submit + .auth-tabs-inline {
  margin-top: 0;
}

.auth-page .auth-footer {
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  text-align: left;
}

.auth-page #auth-register-note:empty {
  display: none;
}

.auth-page .auth-register-feedback[hidden] {
  display: none;
}

.auth-page .auth-register-feedback .auth-note {
  margin-bottom: 8px;
}

.auth-page .auth-link,
.auth-page .auth-text-button {
  color: var(--ds-color-accent);
}

.auth-page .auth-text-button {
  border: 0;
  padding: 4px 0;
  background: transparent;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
}

.auth-page .auth-text-button:hover,
.auth-page .auth-text-button:focus-visible {
  color: #76dcff;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.auth-page .auth-step-panel {
  min-height: 300px;
  align-content: center;
}

.auth-page .auth-inbox-panel,
.auth-page .auth-progress-panel,
.auth-page .auth-success-panel {
  display: grid;
  justify-items: start;
  gap: 22px;
  padding: 16px 2px 4px;
}

.auth-page .auth-state-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  color: var(--ds-color-accent);
  background: rgba(50, 197, 253, 0.12);
  border: 1px solid rgba(50, 197, 253, 0.28);
}

.auth-page .auth-state-icon.is-success {
  color: #5fe38c;
  background: rgba(95, 227, 140, 0.1);
  border-color: rgba(95, 227, 140, 0.3);
}

.auth-page .auth-state-icon svg {
  width: 30px;
  height: 30px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.auth-page .auth-state-copy {
  display: grid;
  gap: 8px;
}

.auth-page .auth-state-copy h2 {
  margin: 0;
  font-size: 28px;
  line-height: 1.2;
}

.auth-page .auth-state-copy p,
.auth-page .auth-state-help {
  margin: 0;
  font-size: 16px;
  line-height: 1.55;
  color: var(--ds-color-text-muted);
}

.auth-page .auth-state-copy strong {
  font-size: 17px;
  word-break: break-word;
}

.auth-page .auth-state-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}

.auth-page .auth-state-note {
  min-height: 21px;
  font-size: 14px;
  color: #5fe38c;
}

.auth-page .auth-spinner {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 3px solid rgba(50, 197, 253, 0.18);
  border-top-color: var(--ds-color-accent);
  animation: auth-spin 0.8s linear infinite;
}

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

.auth-page .project-button.ghost {
  background: rgba(18, 24, 32, 0.92);
  color: #ffffff;
  border: 1px solid var(--panel-border);
  border-radius: var(--ds-radius-sm);
  padding: 12px 18px;
}

.auth-page .project-button.ghost:hover {
  background: rgba(25, 33, 44, 0.98);
  border-color: var(--panel-border-strong);
}

.auth-page .project-button.primary:not(:disabled):hover {
  background: #6ed6fe;
  box-shadow: none;
}

.auth-page .project-button.primary:not(:disabled):active {
  background: #0d8ec2;
}

.auth-page .auth-provider-icon {
  background: transparent;
  box-shadow: none;
}

.auth-page .project-button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  box-shadow: none;
}

.auth-page .auth-submit:disabled {
  background: #32c5fd;
  color: #0d0d0d;
  opacity: 1;
}

@media (max-width: 380px) {
  .auth-page .auth-overlay {
    padding: 16px;
  }

  .auth-page .auth-card {
    width: 100%;
    min-height: 0;
    box-shadow: none;
  }

  .auth-page .auth-panel {
    padding: 24px 20px;
  }

  .auth-page .auth-card.auth-card-single .auth-panel {
    padding: 24px 20px;
  }

  .auth-page .auth-name-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .auth-page .auth-providers {
    grid-template-columns: 1fr;
  }

  .auth-page .auth-state-actions,
  .auth-page .auth-session-actions,
  .auth-page .auth-actions-row {
    align-items: stretch;
    flex-direction: column;
  }

  .auth-page .auth-state-actions .project-button,
  .auth-page .auth-session-actions .project-button {
    width: 100%;
    justify-content: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-page .auth-spinner {
    animation-duration: 1.8s;
  }
}

/* Demo link on the sign-up form (hidden on phones, where the editor is cramped). */
.auth-page .auth-try-first { margin: 14px 0 0; text-align: center; font-size: 14px; color: rgba(214, 228, 240, 0.7); }
.auth-page .auth-try-first a { color: #4dd2ff; font-weight: 600; text-decoration: none; }
.auth-page .auth-try-first a:hover { text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 760px) { .auth-page .auth-try-first { display: none; } }

/* Back button: phones only (below), when there is a page to go back to. */
.auth-page .auth-back { display: none; }
.auth-page .auth-field-message { font-size: 13px; line-height: 1.4; color: #ff6b6b; }
.auth-page .auth-field-message:empty { display: none; }
.auth-page .auth-register-fields > .auth-field-message { margin-top: -10px; }
.auth-page .auth-hint.is-valid { display: flex; align-items: center; gap: 6px; color: #36d183; }
.auth-page .auth-hint.is-valid::before {
  content: ""; flex: none; width: 16px; height: 16px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2336d183' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12 5 5 9-10'/%3E%3C/svg%3E") no-repeat center / 16px 16px;
}

/* Phones: the Claude Design sign-up (17 Oct 2026). No frame around the form, larger type and
   touch targets, 16px inputs so iPhone Safari does not zoom. Sign-in uses the same look; the signed-in
   account screen (body.is-auth-session) keeps its own layout. */
@media (max-width: 560px) {
  body.auth-page:not(.is-auth-session) { background: #0b0d12; }
  body.auth-page:not(.is-auth-session) .auth-overlay { padding: 0; }
  body.auth-page:not(.is-auth-session) .auth-card,
  body.auth-page:not(.is-auth-session) .auth-card.auth-card-single {
    width: 100%; max-width: 430px; margin: 0 auto; min-height: 0;
    background: transparent; border: 0; border-radius: 0; box-shadow: none;
  }
  body.auth-page:not(.is-auth-session) .auth-panel,
  body.auth-page:not(.is-auth-session) .auth-card.auth-card-single .auth-panel { gap: 28px; padding: 0 20px calc(40px + env(safe-area-inset-bottom)); }
  body.auth-page:not(.is-auth-session) .auth-brand-panel { display: flex; flex-direction: row; align-items: center; justify-content: flex-start; gap: 4px; height: 60px; margin: 0; }
  body.auth-page:not(.is-auth-session) .auth-logo { height: 22px; }
  body.auth-page:not(.is-auth-session) .auth-back:not([hidden]) {
    display: grid; place-items: center; width: 40px; height: 44px; margin-left: -12px; padding: 0;
    border: 0; background: transparent; color: rgba(211, 221, 231, 0.7); cursor: pointer;
  }
  body.auth-page:not(.is-auth-session) .auth-back svg { width: 18px; height: 18px; }
  body.auth-page:not(.is-auth-session) .auth-back:focus-visible { outline: 2px solid rgba(50, 197, 253, 0.72); outline-offset: -2px; border-radius: 8px; }
  body.auth-page:not(.is-auth-session) .auth-title { margin-top: 20px; font-size: 32px; font-weight: 600; line-height: 1.1; letter-spacing: -0.02em; }
  body.auth-page:not(.is-auth-session) .auth-subtitle { margin-top: 12px; font-size: 16px; line-height: 1.5; color: rgba(211, 221, 231, 0.7); }
  body.auth-page:not(.is-auth-session) .auth-body { gap: 24px; }
  body.auth-page:not(.is-auth-session) .auth-providers { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  body.auth-page:not(.is-auth-session) .auth-provider {
    min-height: 48px; gap: 10px; border: 0; border-radius: 10px; background: #2e3541;
    font-size: 15px; font-weight: 600;
  }
  body.auth-page:not(.is-auth-session) .auth-provider:hover { background: #3a4350; }
  body.auth-page:not(.is-auth-session) .auth-divider { font-size: 14px; color: rgba(211, 221, 231, 0.62); }
  body.auth-page:not(.is-auth-session) .auth-divider::before,
  body.auth-page:not(.is-auth-session) .auth-divider::after { background: rgba(255, 255, 255, 0.1); }
  body.auth-page:not(.is-auth-session) .auth-form,
  body.auth-page:not(.is-auth-session) #auth-register-form { gap: 24px; }
  body.auth-page:not(.is-auth-session) .auth-register-fields { gap: 18px; }
  body.auth-page:not(.is-auth-session) .auth-name-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  body.auth-page:not(.is-auth-session) .auth-field { gap: 8px; }
  body.auth-page:not(.is-auth-session) .auth-field label { font-size: 14px; color: rgba(211, 221, 231, 0.7); }
  body.auth-page:not(.is-auth-session) .auth-field input {
    height: 46px; min-height: 46px; padding: 0 12px; font-size: 16px;
    background: #2e3541; border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 10px;
  }
  body.auth-page:not(.is-auth-session) .auth-field input::placeholder { color: rgba(255, 255, 255, 0.45); }
  body.auth-page:not(.is-auth-session) .auth-toggle { font-size: 14px; font-weight: 500; }
  body.auth-page:not(.is-auth-session) .auth-password-header .auth-toggle { padding: 8px 0 8px 12px; margin: -8px 0; }
  body.auth-page:not(.is-auth-session) .auth-hint { font-size: 14px; color: rgba(211, 221, 231, 0.62); }
  body.auth-page:not(.is-auth-session) .auth-hint.is-invalid { color: #ff6b6b; }
  body.auth-page:not(.is-auth-session) .auth-hint.is-valid { color: #36d183; }
  body.auth-page:not(.is-auth-session) .auth-consents { gap: 6px; margin-top: -6px; }
  body.auth-page:not(.is-auth-session) .auth-checkbox { grid-template-columns: 20px minmax(0, 1fr); gap: 12px; padding: 8px 0; font-size: 15px; color: rgba(211, 221, 231, 0.7); }
  body.auth-page:not(.is-auth-session) .auth-checkbox input { width: 20px; height: 20px; }
  body.auth-page:not(.is-auth-session) .auth-optional { color: inherit; }
  body.auth-page:not(.is-auth-session) .auth-remember { font-size: 15px; color: rgba(211, 221, 231, 0.7); }
  body.auth-page:not(.is-auth-session) .auth-register-cta { gap: 14px; margin-top: -4px; }
  body.auth-page:not(.is-auth-session) .auth-submit,
  body.auth-page:not(.is-auth-session) .project-button.primary.auth-submit {
    height: auto; min-height: 52px; padding: 12px 18px; border: 1px solid rgba(50, 197, 253, 0.26); border-radius: 10px;
    background-color: #32c5fd; background-image: linear-gradient(180deg, #4dd2ff, #2bc3fd);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), 0 8px 18px rgba(17, 91, 117, 0.22);
    font-size: 16px; font-weight: 600;
  }
  body.auth-page:not(.is-auth-session) .auth-consent-copy { font-size: 13px; color: rgba(211, 221, 231, 0.62); }
  body.auth-page:not(.is-auth-session) .auth-footer { margin-top: 4px; padding-top: 20px; border-top: 1px solid rgba(255, 255, 255, 0.1); }
  body.auth-page:not(.is-auth-session) .auth-tab { gap: 6px; padding: 12px 0; font-size: 15px; }
  body.auth-page:not(.is-auth-session) .auth-switch-prompt { color: rgba(211, 221, 231, 0.7); }
}
/* Small phones keep the stacked name fields and sign-in buttons. */
@media (max-width: 380px) {
  body.auth-page:not(.is-auth-session) .auth-name-row,
  body.auth-page:not(.is-auth-session) .auth-providers { grid-template-columns: 1fr; }
}
