:root {
  --tn-auth-page-bg: #0b0f14;
  --tn-auth-card-bg: rgba(15, 23, 42, .94);
  --tn-auth-card-border: rgba(148, 163, 184, .18);
  --tn-auth-text: #f8fafc;
  --tn-auth-muted: #94a3b8;
  --tn-auth-accent: #6758e7;
  --tn-auth-accent-soft: rgba(103, 88, 231, .16);
  --tn-auth-line: rgba(148, 163, 184, .18);
  --tn-auth-danger: #fca5a5;
  --tn-auth-success: #86efac;
  --tn-auth-warning: #fde68a;
}

body.tn-auth-page-body,
body.tn-auth-page-body *,
body.tn-auth-page-body *::before,
body.tn-auth-page-body *::after {
  box-sizing: border-box;
}

body.tn-auth-page-body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  min-height: 100svh;
  color: var(--tn-auth-text);
  background: var(--tn-auth-page-bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.tn-auth-skip {
  position: fixed;
  z-index: 100;
  top: 12px;
  left: 12px;
  transform: translateY(-180%);
  padding: 10px 14px;
  border-radius: 10px;
  color: #0f172a;
  background: #fff;
  font-weight: 800;
  text-decoration: none;
}

.tn-auth-skip:focus {
  transform: none;
}

.tn-auth-page {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 28px 16px;
  background:
    radial-gradient(circle at 14% 18%, rgba(103, 88, 231, .18), transparent 30%),
    radial-gradient(circle at 86% 82%, rgba(14, 165, 233, .12), transparent 34%),
    linear-gradient(145deg, #080b10 0%, #0b0f14 44%, #111827 100%);
}

.tn-auth-page::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  opacity: .32;
  background-image:
    linear-gradient(rgba(148, 163, 184, .05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, .05) 1px, transparent 1px);
  background-size: 48px 48px;
  -webkit-mask-image: radial-gradient(circle at center, #000 35%, transparent 82%);
  mask-image: radial-gradient(circle at center, #000 35%, transparent 82%);
}

.tn-auth-page__inner {
  position: relative;
  z-index: 1;
  width: min(100%, 520px);
}

[data-tnsuite-auth-root] {
  width: 100%;
}

[data-tnsuite-auth-card] {
  width: min(100%, 520px);
  overflow: hidden;
  border: 1px solid var(--tn-auth-card-border);
  border-radius: 24px;
  color: var(--tn-auth-text);
  background: var(--tn-auth-card-bg);
  box-shadow: 0 28px 80px rgba(0, 0, 0, .34);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.tn-auth-card__header {
  padding: 24px 24px 18px;
  border-bottom: 1px solid var(--tn-auth-line);
}

.tn-auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.tn-auth-brand__mark {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, .18);
  border-radius: 13px;
  background: rgba(255, 255, 255, .06);
}

.tn-auth-brand__mark img {
  width: 34px;
  height: 34px;
  display: block;
  object-fit: contain;
}

.tn-auth-brand__copy {
  min-width: 0;
}

.tn-auth-brand__copy h1 {
  margin: 0;
  color: var(--tn-auth-text);
  font-size: 21px;
  line-height: 1.2;
  letter-spacing: -.02em;
}

.tn-auth-brand__copy p {
  margin: 4px 0 0;
  color: var(--tn-auth-muted);
  font-size: 13px;
  line-height: 1.45;
}

.tn-auth-card__body {
  padding: 22px 24px 24px;
}

.tn-auth-status-stack {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

[data-auth-status] {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 11px 12px;
  border: 1px solid var(--tn-auth-line);
  border-radius: 12px;
  color: var(--tn-auth-muted);
  background: rgba(15, 23, 42, .72);
  font-size: 12px;
  line-height: 1.55;
}

[data-auth-status][data-kind="error"] {
  color: #fee2e2;
  border-color: rgba(248, 113, 113, .32);
  background: rgba(127, 29, 29, .35);
}

[data-auth-status][data-kind="success"] {
  color: #dcfce7;
  border-color: rgba(74, 222, 128, .28);
  background: rgba(20, 83, 45, .30);
}

[data-auth-status][data-kind="warning"] {
  color: #fef3c7;
  border-color: rgba(251, 191, 36, .30);
  background: rgba(120, 53, 15, .30);
}

.tn-auth-methods {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.tn-auth-provider {
  min-width: 0;
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(148, 163, 184, .22);
  border-radius: 14px;
  color: var(--tn-auth-text);
  background: rgba(255, 255, 255, .045);
  font: inherit;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease;
}

.tn-auth-provider:hover:not(:disabled),
.tn-auth-provider:focus-visible {
  outline: none;
  transform: translateY(-1px);
  border-color: rgba(167, 139, 250, .72);
  background: rgba(255, 255, 255, .075);
  box-shadow: 0 10px 26px rgba(0, 0, 0, .18);
}

.tn-auth-provider:focus-visible,
.tn-auth-local-toggle:focus-visible,
.tn-auth-field input:focus-visible,
.tn-auth-password-toggle:focus-visible,
.tn-auth-submit:focus-visible,
.tn-auth-card__footer a:focus-visible {
  outline: 3px solid rgba(167, 139, 250, .72);
  outline-offset: 2px;
}

.tn-auth-provider:disabled,
.tn-auth-provider[aria-disabled="true"] {
  cursor: not-allowed;
}

.tn-auth-provider[data-state="disabled"],
.tn-auth-provider[data-state="not_configured"] {
  opacity: .50;
}

.tn-auth-provider[data-state="checking"],
.tn-auth-provider[data-state="authenticating"] {
  border-color: rgba(167, 139, 250, .72);
  background: rgba(103, 88, 231, .14);
}

.tn-auth-provider[data-state="success"] {
  border-color: rgba(74, 222, 128, .45);
}

.tn-auth-provider[data-state="error"] {
  border-color: rgba(248, 113, 113, .55);
}

.tn-auth-provider__icon {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: #fff;
  background: rgba(255, 255, 255, .08);
  font-size: 14px;
  font-weight: 900;
}

.tn-auth-provider__copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.tn-auth-provider__copy strong {
  font-size: 12px;
  line-height: 1.25;
}

.tn-auth-provider__copy small {
  overflow: hidden;
  color: var(--tn-auth-muted);
  font-size: 9px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tn-auth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0 14px;
  color: var(--tn-auth-muted);
}

.tn-auth-divider::before,
.tn-auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--tn-auth-line);
}

.tn-auth-divider span {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .12em;
}

.tn-auth-local-toggle {
  width: 100%;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid var(--tn-auth-line);
  border-radius: 14px;
  color: var(--tn-auth-text);
  background: rgba(255, 255, 255, .045);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease;
}

.tn-auth-local-toggle:hover:not(:disabled) {
  border-color: rgba(167, 139, 250, .58);
  background: rgba(255, 255, 255, .07);
}

.tn-auth-local-toggle:disabled {
  opacity: .50;
  cursor: not-allowed;
}

.tn-auth-local-toggle__label {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.tn-auth-local-toggle__chevron {
  color: var(--tn-auth-muted);
  transition: transform .18s ease;
}

.tn-auth-local-toggle[aria-expanded="true"] .tn-auth-local-toggle__chevron {
  transform: rotate(180deg);
}

.tn-auth-local-panel {
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity .18s ease, transform .18s ease;
}

.tn-auth-local-panel.is-open {
  opacity: 1;
  transform: none;
}

.tn-auth-local-panel[hidden] {
  display: none;
}

.tn-auth-local-panel__inner {
  padding: 15px 2px 0;
}

.tn-auth-local-help {
  margin: 0 0 13px;
  color: var(--tn-auth-muted);
  font-size: 12px;
  line-height: 1.55;
}

.tn-auth-form {
  display: grid;
  gap: 13px;
}

.tn-auth-field {
  display: grid;
  gap: 7px;
}

.tn-auth-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.tn-auth-field label {
  color: #cbd5e1;
  font-size: 11px;
  font-weight: 800;
}

.tn-auth-label-row a {
  color: #c4b5fd;
  font-size: 11px;
  text-decoration: none;
}

.tn-auth-field input {
  width: 100%;
  min-height: 48px;
  box-sizing: border-box;
  padding: 11px 13px;
  border: 1px solid rgba(148, 163, 184, .28);
  border-radius: 14px;
  outline: none;
  color: var(--tn-auth-text);
  background: rgba(2, 6, 23, .42);
  font: inherit;
  font-size: 14px;
}

.tn-auth-field input::placeholder {
  color: #64748b;
}

.tn-auth-field input:focus {
  border-color: rgba(167, 139, 250, .76);
  box-shadow: 0 0 0 3px rgba(103, 88, 231, .17);
}

.tn-auth-field__error {
  color: var(--tn-auth-danger);
  font-size: 11px;
  line-height: 1.45;
}

.tn-auth-password {
  position: relative;
}

.tn-auth-password input {
  padding-right: 52px;
}

.tn-auth-password-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  transform: translateY(-50%);
  border: 0;
  border-radius: 11px;
  color: #cbd5e1;
  background: transparent;
  cursor: pointer;
}

.tn-auth-password-toggle:hover {
  background: rgba(255, 255, 255, .07);
}

.tn-auth-submit {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 0;
  border-radius: 14px;
  color: #fff;
  background: var(--tn-auth-accent);
  font: inherit;
  font-size: 13px;
  font-weight: 850;
  cursor: pointer;
  transition: transform .18s ease, filter .18s ease, box-shadow .18s ease;
}

.tn-auth-submit:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.08);
  box-shadow: 0 12px 28px rgba(103, 88, 231, .26);
}

.tn-auth-submit:disabled {
  opacity: .66;
  cursor: wait;
}

.tn-auth-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 24px 16px;
  border-top: 1px solid var(--tn-auth-line);
  color: var(--tn-auth-muted);
  font-size: 10px;
  line-height: 1.4;
}

.tn-auth-card__footer-group {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.tn-auth-card__footer a {
  color: #cbd5e1;
  text-decoration: none;
}

.tn-auth-card__footer a:hover {
  color: #fff;
}

@media (max-width: 620px) {
  .tn-auth-page {
    align-items: start;
    padding: 18px 12px;
  }

  .tn-auth-page__inner {
    margin: auto 0;
  }

  [data-tnsuite-auth-card] {
    border-radius: 20px;
  }

  .tn-auth-card__header {
    padding: 20px 18px 16px;
  }

  .tn-auth-card__body {
    padding: 18px 18px 20px;
  }

  .tn-auth-methods {
    grid-template-columns: 1fr;
  }

  .tn-auth-provider {
    justify-content: flex-start;
    padding-inline: 13px;
    text-align: left;
  }

  .tn-auth-provider__copy small {
    white-space: normal;
  }

  .tn-auth-card__footer {
    align-items: flex-start;
    flex-direction: column;
    padding-inline: 18px;
  }

  .tn-auth-card__footer-group {
    flex-wrap: wrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
  }

  .tn-auth-provider,
  .tn-auth-local-toggle,
  .tn-auth-local-toggle__chevron,
  .tn-auth-local-panel,
  .tn-auth-submit {
    transition: none !important;
  }
}

/* Unsupported/not-configured providers remain visible in their canonical slot.
   They stay non-executable through disabled/aria-disabled state semantics. */

/* The author-level status display rule must never override the native hidden contract. */
[data-auth-status][hidden] {
  display: none;
}
