.auth-shell {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  background: var(--public-warm-background);
}

.auth-header {
  display: flex;
  height: 64px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--color-border);
  padding: 0 40px;
}

.auth-brand {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  gap: 8px;
  color: var(--color-foreground);
  text-decoration: none;
}

.auth-brand__mark {
  display: inline-flex;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  background: var(--color-primary);
  color: var(--color-primary-foreground);
  font-size: 14px;
  font-weight: 700;
}

.auth-brand__name {
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
}

.auth-header-link {
  display: inline-flex;
  height: 36px;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  padding: 0 12px;
  color: var(--color-foreground);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
}

.auth-header-link:hover {
  background: #f5f5f5;
}

.auth-main {
  display: flex;
  width: 100%;
  flex: 1;
  flex-direction: column;
  margin: 0 auto;
  padding-right: 24px;
  padding-left: 24px;
}

.auth-main--login {
  max-width: none;
  align-items: center;
  padding-top: 48px;
  padding-bottom: 48px;
}

.auth-main--signup {
  max-width: none;
  align-items: center;
  padding-top: 48px;
  padding-bottom: 48px;
}

.auth-card {
  width: min(480px, 100%);
  border: 1px solid var(--public-warm-border);
  border-radius: 6px;
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(134, 114, 87, 0.1);
  color: #414141;
  padding: 32px 36px 28px;
}

.auth-card .auth-heading h1 {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.4;
}

.auth-card .auth-form {
  margin-top: 24px;
}

.auth-card .auth-field label {
  font-weight: 600;
}

.auth-card .auth-check input {
  accent-color: var(--color-brand);
}

.auth-card .auth-field input:focus,
.auth-card .auth-field select:focus {
  border-color: var(--color-brand);
  box-shadow: 0 0 0 3px rgba(200, 20, 20, 0.18);
}

.auth-card .public-button {
  height: 44px;
  margin-top: 4px;
  font-size: 15px;
  font-weight: 600;
}

.auth-card .auth-link--primary {
  color: var(--color-brand);
  font-weight: 600;
}

.auth-main--result,
.auth-main--complete {
  max-width: none;
  align-items: center;
  padding-top: 56px;
  padding-bottom: 56px;
}

.auth-main--complete {
  padding-top: 48px;
  padding-bottom: 48px;
}

.auth-complete-state {
  display: flex;
  width: 100%;
  flex-direction: column;
  align-items: center;
  gap: 32px;
}

.auth-complete-state.auth-card {
  gap: 24px;
}

.auth-complete-state.auth-card .auth-form {
  margin-top: 0;
}

.auth-card--result {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
}

.auth-card .auth-action-row {
  margin-top: 8px;
}

.auth-card .auth-action-row .public-button {
  margin-top: 0;
}

.auth-complete-state[hidden] {
  display: none;
}

.auth-heading {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.auth-heading--center {
  align-items: center;
  gap: 12px;
  text-align: center;
}

.auth-heading h1 {
  margin: 0;
  color: var(--color-foreground);
  font-size: 26px;
  font-weight: 600;
  line-height: 1.25;
}

.auth-heading p {
  margin: 0;
  color: var(--color-muted);
  font-size: 13px;
  line-height: 1.7;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.auth-form--wide {
  width: 100%;
}

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

.auth-field__label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.auth-field label {
  color: var(--color-foreground);
  font-size: 13px;
  font-weight: 500;
}

.auth-field input,
.auth-field select {
  width: 100%;
  height: 44px;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  background: var(--color-background);
  color: var(--color-foreground);
  font: inherit;
  font-size: 14px;
  outline: none;
  padding: 0 12px;
}

.auth-field input::placeholder {
  color: #a3a3a3;
}

.auth-field input:focus,
.auth-field select:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-ring);
}

.auth-help {
  color: var(--color-muted);
  font-size: 11px;
  line-height: 1.5;
}

.auth-prompt {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding-top: 8px;
  color: var(--color-muted);
  font-size: 13px;
}

.auth-link {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.auth-link--muted {
  color: var(--color-muted);
  font-size: 11px;
  text-decoration: none;
}

.auth-link--muted:hover {
  color: var(--color-foreground);
  text-decoration: underline;
}

.auth-link--primary {
  color: var(--color-primary);
  font-weight: 500;
  text-decoration: none;
}

.auth-link--primary:hover,
.auth-link--plain:hover {
  text-decoration: underline;
}

.auth-link--plain {
  text-decoration: underline;
}

.auth-required {
  color: var(--color-danger);
}

.auth-alert {
  border: 1px solid rgba(220, 38, 38, 0.22);
  border-radius: 4px;
  background: var(--color-danger-background);
  color: var(--color-danger);
  font-size: 13px;
  line-height: 1.5;
  padding: 10px 12px;
}

.auth-alert--success {
  border-color: rgba(22, 163, 74, 0.22);
  background: #f0fdf4;
  color: #15803d;
}

.auth-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--color-foreground);
  font-size: 13px;
  line-height: 1.6;
}

.auth-check input {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  margin: 3px 0 0;
  accent-color: var(--color-primary);
}

.auth-check span {
  display: inline;
}

.auth-check__hint {
  display: block;
  color: var(--color-muted);
  font-size: 11px;
  line-height: 1.5;
}

.auth-status-icon {
  display: flex;
  width: 80px;
  height: 80px;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  font-size: 36px;
  font-weight: 600;
  line-height: 1;
}

.auth-status-icon--primary {
  background: rgba(23, 23, 23, 0.08);
  color: var(--color-primary);
}

.auth-status-icon--danger {
  background: var(--color-danger-background);
  color: var(--color-danger);
}

.auth-note-list {
  display: flex;
  width: 100%;
  flex-direction: column;
  border-top: 1px solid var(--color-border);
  list-style: none;
  margin: 0;
  padding: 0;
}

.auth-note-list li {
  border-bottom: 1px solid rgba(229, 229, 229, 0.72);
  color: var(--color-muted);
  font-size: 13px;
  line-height: 1.7;
  padding: 12px 0;
}

.auth-note-list li::before {
  content: "i";
  display: inline-flex;
  width: 15px;
  height: 15px;
  align-items: center;
  justify-content: center;
  border: 1px solid #a3a3a3;
  border-radius: 9999px;
  margin-right: 10px;
  color: var(--color-muted);
  font-size: 10px;
  font-weight: 600;
  vertical-align: 1px;
}

.auth-action-row {
  display: flex;
  width: 100%;
  flex-direction: row-reverse;
  gap: 12px;
}

.auth-fieldset {
  display: flex;
  flex-direction: column;
  gap: 10px;
  border: 0;
  margin: 0;
  padding: 0;
}

.auth-fieldset legend {
  color: var(--color-foreground);
  font-size: 13px;
  font-weight: 500;
  margin: 0;
  padding: 0;
}

.auth-fieldset > label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--color-foreground);
  font-size: 13px;
  line-height: 1.5;
}

.auth-fieldset input[type="radio"],
.auth-fieldset input[type="checkbox"] {
  accent-color: var(--color-primary);
}

.auth-pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 4px;
}

.auth-pill-group label {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--color-border);
  border-radius: 9999px;
  padding: 0 12px;
  color: var(--color-foreground);
  font-size: 12px;
}

.auth-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  border-top: 1px solid var(--color-border);
  padding: 24px;
}

.auth-footer__links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
}

.auth-footer__links a {
  color: var(--color-muted);
  font-size: 12px;
  text-decoration: none;
}

.auth-footer__links a:hover {
  color: var(--color-foreground);
  text-decoration: underline;
}

.auth-footer__copyright {
  margin: 0;
  color: var(--color-muted);
  font-size: 12px;
}

@media (max-width: 640px) {
  .auth-header {
    height: 56px;
    padding: 0 16px;
  }

  .auth-brand__mark {
    width: 28px;
    height: 28px;
    font-size: 13px;
  }

  .auth-brand__name {
    font-size: 13px;
  }

  .auth-main--login,
  .auth-main--signup,
  .auth-main--result,
  .auth-main--complete {
    max-width: none;
    gap: 24px;
    padding: 40px 16px;
  }

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

  .auth-status-icon {
    width: 64px;
    height: 64px;
    font-size: 28px;
  }

  .auth-action-row {
    flex-direction: column;
    gap: 10px;
  }

  .auth-card .auth-heading h1 {
    font-size: 18px;
  }

  .auth-heading p,
  .auth-prompt {
    font-size: 12px;
  }

  .auth-prompt {
    flex-wrap: wrap;
  }
}
