/* Auth state colors only. Templates retain their existing geometry and type.
 * Load after theme-tokens.css; .tb-theme-auth is an explicit page opt-in.
 */
.tb-theme-auth { color: var(--tb-text); color-scheme: light; }
.tb-theme-auth ::selection { color: var(--tb-selection-fg); background: var(--tb-selection-bg); }
.tb-theme-auth :is(.auth-header, .google-verify-card, .rtx-title) :is(h1, h2) { color: var(--tb-heading); }
.tb-theme-auth :is(.subtitle, .help) { color: var(--tb-text-muted); }

.tb-theme-auth a:not(.google-continue) { color: var(--tb-link); text-decoration: underline; }
.tb-theme-auth a:not(.google-continue):hover { color: var(--tb-link-hover); }
.tb-theme-auth :is(a, button, summary):focus-visible {
  outline: 2px solid var(--tb-focus);
  outline-offset: 3px;
}

/* The notch itself is the only focused field boundary: no second outer box. */
.tb-theme-auth .notched-field { border-color: var(--tb-border-control); }
.tb-theme-auth .n-input { color: var(--tb-text); caret-color: var(--tb-text); }
.tb-theme-auth .n-label { color: var(--tb-text-muted); background: var(--tb-surface); }
.tb-theme-auth .n-input:focus + .n-label,
.tb-theme-auth .n-input:not(:placeholder-shown) + .n-label,
.tb-theme-auth .n-input:autofill + .n-label,
.tb-theme-auth .n-input:-webkit-autofill + .n-label,
.tb-theme-auth .notched-field.is-filled .n-label { color: var(--tb-brand); }
.tb-theme-auth .n-input:autofill,
.tb-theme-auth .n-input:-webkit-autofill {
  box-shadow: 0 0 0 1000px var(--tb-surface) inset !important;
  -webkit-text-fill-color: var(--tb-text) !important;
  caret-color: var(--tb-text);
}
.tb-theme-auth .notched-field:focus-within { border-color: var(--tb-focus); }
.tb-theme-auth .notched-field:has(.n-input:user-invalid),
.tb-theme-auth .notched-field:has(.n-input[aria-invalid="true"]) { border-color: var(--tb-danger); }
.tb-theme-auth .notched-field:has(.n-input:user-invalid) .n-label,
.tb-theme-auth .notched-field:has(.n-input[aria-invalid="true"]) .n-label { color: var(--tb-danger); }
.tb-theme-auth .n-input:disabled { color: var(--tb-disabled-text); opacity: 1; }
.tb-theme-auth .google-verify-card input,
.tb-theme-auth .rtx-key { color: var(--tb-text); background: var(--tb-surface); }
.tb-theme-auth .google-verify-card input:focus-visible,
.tb-theme-auth .rtx-key:focus {
  border-color: var(--tb-focus);
  outline: 2px solid var(--tb-focus);
  outline-offset: -2px;
  box-shadow: none;
}
.tb-theme-auth .google-verify-card input:user-invalid { border-color: var(--tb-danger); }
.tb-theme-auth .google-verify-card input:autofill,
.tb-theme-auth .google-verify-card input:-webkit-autofill {
  box-shadow: 0 0 0 1000px var(--tb-surface) inset !important;
  -webkit-text-fill-color: var(--tb-text) !important;
  caret-color: var(--tb-text);
}

.tb-theme-auth .toggle {
  color: var(--tb-brand);
  background: var(--tb-surface-soft);
  border-color: var(--tb-border-control);
}
.tb-theme-auth .toggle:not(:disabled):hover { background: var(--tb-selection-bg); }
.tb-theme-auth .toggle:not(:disabled):active { background: var(--tb-sidebar-bg); }
.tb-theme-auth :is(.btn-auth, .rtx-btn, .google-verify-card button):not(:disabled):not([aria-disabled="true"]):hover {
  background: var(--tb-action-hover);
}
.tb-theme-auth :is(.btn-auth, .rtx-btn, .google-verify-card button):not(:disabled):not([aria-disabled="true"]):active {
  background: var(--tb-action-pressed);
}
.tb-theme-auth :is(.btn-auth, .rtx-btn, .google-verify-card button):disabled:not(.loading) {
  color: var(--tb-disabled-text);
  background: var(--tb-disabled-bg);
  box-shadow: none;
  opacity: 1;
}
.tb-theme-auth .btn-auth.loading {
  color: var(--tb-on-brand);
  background: var(--tb-action-bg);
  opacity: 1;
}

/* Category text remains explicit; hue is an additional cue. */
.tb-theme-auth :is(.alert, .rtx-alert) {
  color: var(--tb-info-text);
  background: var(--tb-info-bg);
  border-color: var(--tb-info-text);
}
.tb-theme-auth :is(.alert-success, .rtx-alert-success) {
  color: var(--tb-success-text);
  background: var(--tb-success-bg);
  border-color: var(--tb-success-text);
}
.tb-theme-auth :is(.alert-error, .alert-danger, .rtx-alert-error, .rtx-alert-danger) {
  color: var(--tb-danger);
  background: var(--tb-danger-bg);
  border-color: var(--tb-danger);
}
.tb-theme-auth :is(.alert-warning, .rtx-alert-warning) {
  color: var(--tb-warning-text);
  background: var(--tb-warning-bg);
  border-color: var(--tb-warning-text);
}
.tb-theme-auth .rtx-reveal[open] summary { color: var(--tb-selection-fg); background: var(--tb-selection-bg); }

@media (forced-colors: active) {
  .tb-theme-auth .n-input:autofill,
  .tb-theme-auth .n-input:-webkit-autofill,
  .tb-theme-auth .google-verify-card input:autofill,
  .tb-theme-auth .google-verify-card input:-webkit-autofill {
    box-shadow: none !important;
    -webkit-text-fill-color: FieldText !important;
  }
}
