/* Login page styles */

.tn-login {
  grid-template-columns: minmax(420px, 52vw) minmax(0, 1fr);
}

.tn-login .tn-shell-billboard {
  order: 2;
}

.tn-login-rail {
  order: 1;
  justify-content: center;
  align-items: center;
  gap: 0;
  border-right: none;
  z-index: 2;
  padding: clamp(2rem, 5vh, 3rem) clamp(1.75rem, 4.5vw, 3.25rem);
  padding-bottom: clamp(3.5rem, 6vh, 4.5rem);
}

/* Fluid smoke layer: paints above the rail background, below all content. */
.tn-login-smoke {
  position: absolute;
  inset: 0;
  z-index: -1;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
  user-select: none;
}

.tn-login-cluster {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 1.9rem;
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
}

.tn-login-form {
  display: flex;
  flex-direction: column;
  gap: 1.3rem;
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  flex: 0 0 auto;
}

.tn-login-form[hidden] {
  display: none;
}

/* ── Footer ───────────────────────────────────────────────────── */

.tn-login .tn-shell-meta {
  position: absolute;
  bottom: clamp(1rem, 2.5vh, 1.5rem);
  left: 50%;
  transform: translateX(-50%);
  margin-top: 0;
  padding-top: 0;
  width: max-content;
  max-width: calc(100% - 3rem);
  justify-content: center;
  flex-wrap: nowrap;
  white-space: nowrap;
}


.tn-login-heading {
  margin: 0 0 0.5rem;
  font-size: 1.9rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--text);
}

.tn-login-lede {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 0 0 0.25rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--line);
}

.tn-login-lede-title {
  margin: 0;
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--text);
}

.tn-login-lede-body {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.4;
  color: var(--text-2);
}

.tn-login-fields {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.tn-login-field {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin: 0;
  min-width: 0;
}

.tn-login-label {
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-2);
}


.tn-login-input-shell {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 54px;
  border-radius: 12px;
  border: 1.5px solid var(--line);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition:
    border-color 220ms ease,
    background 220ms ease,
    box-shadow 220ms ease;
}

@media (hover: hover) {
  .tn-login-input-shell:hover:not(:has(input:disabled)) {
    border-color: rgba(255, 255, 255, 0.18);
    background: var(--surface);
  }
}

.tn-login-input-shell:focus-within {
  border-color: rgba(255, 255, 255, 0.38);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.08);
  background: var(--surface);
}

.tn-login-field-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 2.85rem;
  color: rgba(255, 255, 255, 0.25);
  pointer-events: none;
  transition: color 220ms ease;
}

.tn-login-input-shell:has(input:not(:placeholder-shown)) .tn-login-field-icon {
  color: rgba(255, 255, 255, 0.4);
}

.tn-login-input-shell:focus-within .tn-login-field-icon {
  color: rgba(255, 255, 255, 0.75);
}

.tn-login-field-icon-svg {
  display: block;
}

.tn-login-input-shell input {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  min-height: 52px;
  padding: 0 16px 0 0;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 1.05rem;
  font-weight: 550;
  letter-spacing: -0.015em;
  outline: none;
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.tn-login-input-shell:not(:has(.tn-login-field-icon)) input {
  padding-left: 16px;
}

.tn-login-input-shell.has-trailing input {
  padding-right: 0.35rem;
}

.tn-login-input-shell input::placeholder {
  color: rgba(255, 255, 255, 0.24);
  font-weight: 450;
}

.tn-login-input-shell input:-webkit-autofill,
.tn-login-input-shell input:-webkit-autofill:hover,
.tn-login-input-shell input:-webkit-autofill:focus,
.tn-login-input-shell input:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 60px var(--surface) inset !important;
  box-shadow: 0 0 0 60px var(--surface) inset !important;
  -webkit-text-fill-color: var(--text) !important;
  caret-color: var(--text);
  transition: background-color 5000s ease-in-out 0s;
}

.tn-login-input-shell input:disabled {
  opacity: 0.7;
  cursor: wait;
}

.tn-login-eye {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  margin: 0 4px 0 0;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: rgba(255, 255, 255, 0.3);
  cursor: pointer;
  outline: none;
  aspect-ratio: 1;
  transition:
    color 200ms ease,
    background 200ms ease;
}

.tn-login-eye:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 55%, transparent);
  outline-offset: 2px;
}

@media (hover: hover) {
  .tn-login-eye:hover:not(:disabled) {
    color: rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.06);
  }
}

.tn-login-eye.is-open {
  color: rgba(255, 255, 255, 0.65);
}

.tn-login-eye:focus-visible {
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.14);
}

.tn-login-eye:disabled {
  opacity: 0.5;
  cursor: wait;
}

.tn-login-eye-stack {
  position: relative;
  display: block;
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
}

.tn-login-eye-layer {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transform-origin: center center;
}

.tn-login-eye-layer svg {
  display: block;
  width: 20px;
  height: 20px;
  max-width: 20px;
  max-height: 20px;
  aspect-ratio: 1;
  overflow: visible;
  flex-shrink: 0;
}


.tn-login-remember {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  margin: 0.15rem 0 0.35rem;
  font-size: 0.95rem;
  font-weight: 550;
  color: var(--text-2);
  cursor: pointer;
  user-select: none;
  width: fit-content;
}

.tn-login-remember-box {
  position: relative;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 6px;
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.055);
  color: #fff;
  transition:
    border-color 200ms ease,
    background 200ms ease,
    box-shadow 200ms ease;
}

.tn-login-remember-box input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  cursor: pointer;
}

.tn-login-remember-box:has(input:focus-visible) {
  outline: 2px solid color-mix(in srgb, var(--accent) 55%, transparent);
  outline-offset: 2px;
}

.tn-login-remember-check {
  display: grid;
  place-items: center;
  pointer-events: none;
}

.tn-login-remember:has(input:checked) .tn-login-remember-box {
  border-color: rgba(255, 255, 255, 0.32);
  background: linear-gradient(135deg, #18181b 0%, #27272a 100%);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

@media (hover: hover) {
  .tn-login-remember:hover {
    color: var(--text);
  }
  .tn-login-remember:hover .tn-login-remember-box {
    border-color: rgba(255, 255, 255, 0.22);
  }
}

.tn-login .tn-login-submit.btn,
.tn-login .tn-login-submit.btn-primary,
.tn-login button.tn-login-submit {
  min-height: 54px;
  margin-top: 0.05rem;
  border-radius: 12px;
  font-size: 1.05rem;
  font-weight: 650;
  letter-spacing: -0.015em;
  background: #ffffff;
  border: none;
  color: var(--bg);
  cursor: pointer;
  transition:
    transform 160ms var(--ease),
    opacity 200ms ease;
}

@media (hover: hover) {
  .tn-login .tn-login-submit:hover:not(:disabled) {
    opacity: 0.9;
    transform: translateY(-1px);
  }
}

.tn-login .tn-login-submit:active:not(:disabled) {
  transform: translateY(0.5px) scale(0.99);
  opacity: 0.85;
  transition-duration: 60ms;
}

.tn-login .tn-login-submit:disabled {
  opacity: 0.45;
  transform: none;
  cursor: wait;
  pointer-events: none;
}


@media (max-width: 960px) {
  .tn-login {
    grid-template-columns: 1fr;
  }

  .tn-login .tn-shell-billboard {
    order: 0;
    min-height: 0;
  }

  .tn-login-rail {
    order: 1;
    min-height: 0;
    justify-content: flex-start;
    align-items: stretch;
    padding: 1.25rem 1.25rem 1.1rem;
    gap: 1rem;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .tn-login-cluster {
    max-width: none;
    gap: 1rem;
  }

  .tn-login-form {
    max-width: none;
    flex: 0 0 auto;
    gap: 0.85rem;
  }

  .tn-login-lede {
    margin: 0;
    padding-bottom: 0.25rem;
  }

  .tn-login-lede-title {
    font-size: 1.25rem;
  }

  .tn-login-lede-body {
    font-size: 0.85rem;
  }

  .tn-login-fields {
    gap: 0.7rem;
  }

  .tn-login-input-shell {
    min-height: 50px;
    border-radius: 12px;
  }

  .tn-login-input-shell input {
    min-height: 48px;
    border-radius: 12px;
  }

  .tn-login-eye {
    width: 40px;
    height: 40px;
    border-radius: 10px;
  }

  .tn-login .tn-login-submit.btn,
  .tn-login .tn-login-submit.btn-primary,
  .tn-login button.tn-login-submit {
    min-height: 50px;
  }

  .tn-login .tn-shell-meta {
    position: static;
    transform: none;
    left: auto;
    bottom: auto;
    width: auto;
    max-width: none;
    margin-top: 1rem;
    flex-shrink: 0;
    justify-content: center;
  }

  .tn-login .tn-shell-title {
    font-size: 1.45rem;
  }
}

/* ── Login entrance & state animations ──────────────────────────── */

@keyframes tn-up {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

.tn-entrance { animation: tn-up .38s cubic-bezier(.22,1,.36,1) both; }
.tn-entrance-1 { animation-delay: 0ms; }
.tn-entrance-2 { animation-delay: 60ms; }
#eye-open { opacity: 0; }
#eye-closed { opacity: 1; }
.tn-login-eye.is-open #eye-open { opacity: 1; }
.tn-login-eye.is-open #eye-closed { opacity: 0; }
.tn-login-eye-layer { transition: opacity .18s ease; }
.tn-login-remember-check {
  transition: transform .2s cubic-bezier(.33,1,.68,1),
              opacity .2s cubic-bezier(.33,1,.68,1);
}
.tn-login-remember-box:has(input:not(:checked)) .tn-login-remember-check { transform: scale(.4); opacity: 0; }
.tn-login-submit.is-loading { opacity: .6; pointer-events: none; }

.tn-login-error-line {
  min-height: 1.25rem;
  color: var(--danger);
  font-size: .88rem;
  font-weight: 550;
  text-align: center;
}

.tn-login-back {
  background: none;
  border: none;
  color: var(--text-2);
  font-size: .85rem;
  font-weight: 550;
  cursor: pointer;
  padding: .4rem 0;
  text-align: center;
}
@media (hover: hover) {
  .tn-login-back:hover {
    color: var(--text);
  }
}

.tn-login-trust-note {
  margin: 0;
  padding-left: 1.7rem;
  font-size: 0.74rem;
  font-weight: 500;
  color: var(--text-3, rgba(255,255,255,0.42));
  line-height: 1.35;
}

/* ── Verification step layout ───────────────────────────────────── */

.tn-tfa-form {
  gap: 1.15rem;
}

.tn-tfa-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.4rem;
}

.tn-tfa-form .tn-login-heading {
  margin: 0;
}

.tn-tfa-lede {
  margin: 0;
  max-width: 100%;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-2);
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tn-tfa-otp-block {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.85rem;
  margin-top: 0.15rem;
}

.tn-tfa-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  margin: 0;
  color: var(--text-3, rgba(255,255,255,0.42));
  font-size: 0.78rem;
  font-weight: 550;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.tn-tfa-meta-item {
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}

.tn-tfa-meta-item #tfa-countdown,
.tn-tfa-meta-item #tfa-attempts {
  font-weight: 650;
  color: var(--text);
}

.tn-tfa-meta-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.28);
  flex: 0 0 auto;
}

.tn-tfa-resend {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--text-2);
  font-size: 0.82rem;
  font-weight: 550;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  transition:
    color 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

.tn-tfa-resend-label {
  color: var(--text-3, rgba(255,255,255,0.42));
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  flex: 0 0 auto;
}

.tn-tfa-resend code {
  flex: 0 0 auto;
  font-family: 'JetBrains Mono', 'Fira Code', ui-monospace, monospace;
  font-size: 0.8rem;
  font-weight: 650;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  padding: 0.12rem 0.4rem;
  border-radius: 6px;
}

.tn-tfa-resend-bot {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #e4e4e7;
  font-weight: 600;
}

@media (hover: hover) {
  .tn-tfa-resend:hover {
    color: var(--text);
    border-color: rgba(255, 255, 255, 0.24);
    background: rgba(255, 255, 255, 0.06);
  }
}

.tn-tfa-trust {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 0.1rem 0 0;
}

.tn-tfa-trust-label {
  margin: 0;
}

.tn-tfa-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.2rem;
}

.tn-tfa-actions .tn-login-submit {
  margin-top: 0;
}

.tn-tfa-actions .tn-login-back {
  margin-top: 0.05rem;
}

/* ── OTP 6-box ──────────────────────────────────────────────────── */

.tn-otp {
  position: relative;
  width: 100%;
}

.tn-otp-autofill {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.02;
  border: 0;
  padding: 0;
  margin: 0;
  color: transparent;
  caret-color: transparent;
  background: transparent;
  pointer-events: none;
  z-index: 0;
}

.tn-otp-cells {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto repeat(3, minmax(0, 1fr));
  align-items: center;
  gap: 0.4rem;
  width: 100%;
}

.tn-otp-gap {
  width: 0.5rem;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.35),
    transparent
  );
  justify-self: center;
}

.tn-otp-cell {
  width: 100%;
  min-width: 0;
  height: 3.35rem;
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  font-family: 'Montserrat', var(--font-ui);
  font-size: 1.4rem;
  font-weight: 650;
  letter-spacing: 0;
  text-align: center;
  caret-color: #e4e4e7;
  outline: none;
  -webkit-font-smoothing: antialiased;
  transition:
    border-color 200ms ease,
    background 200ms ease,
    box-shadow 200ms ease,
    transform 160ms ease;
}

@media (hover: hover) {
  .tn-otp-cell:hover:not(:disabled):not(:focus) {
    border-color: rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.03);
  }
}

.tn-otp-cell:focus {
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
  background: var(--surface);
  transform: translateY(-1px);
}

.tn-otp-cell.is-filled {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.04);
}

.tn-otp-cell.is-filled:focus {
  border-color: rgba(255, 255, 255, 0.5);
}

.tn-otp-cell:disabled {
  opacity: 0.55;
  cursor: wait;
}

.tn-otp.is-error .tn-otp-cell {
  border-color: rgba(220, 90, 110, 0.5);
  animation: tn-otp-shake 420ms cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes tn-otp-shake {
  0%, 100% { transform: translateX(0); }
  18% { transform: translateX(-5px); }
  36% { transform: translateX(5px); }
  54% { transform: translateX(-3px); }
  72% { transform: translateX(3px); }
  90% { transform: translateX(-1px); }
}

@media (max-width: 960px) {
  .tn-tfa-form {
    gap: 1rem;
  }
  .tn-otp-cells {
    gap: 0.3rem;
  }
  .tn-otp-gap {
    width: 0.35rem;
  }
  .tn-otp-cell {
    height: 2.9rem;
    border-radius: 10px;
    font-size: 1.2rem;
  }
  .tn-tfa-resend {
    padding: 0.65rem 0.75rem;
    gap: 0.35rem;
    font-size: 0.78rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tn-otp.is-error .tn-otp-cell {
    animation: none;
  }
  .tn-otp-cell:focus {
    transform: none;
  }
}

