/* TQ Tag Site Manager — API login
   Tokens and page chrome are scoped so they cannot leak onto html.tq-admin. */
html:not(.tq-admin) {
  --tq-primary: #6638b6;
  --tq-primary-dark: #5a2fa0;
  --tq-primary-rgb: 102, 56, 182;
  --tq-surface: #0f0f12;
  --tq-card: #18181c;
  --tq-border: rgba(255, 255, 255, 0.08);
  --tq-text: #f4f4f5;
  --tq-muted: #a1a1aa;
  --tq-radius: 14px;
  --tq-font: "Poppins", system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html:not(.tq-admin) {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

/* Hide login chrome while resuming session (tq_jwt present) until gate runs */
html.tq-login-resuming .tq-login {
  visibility: hidden;
}

html:not(.tq-admin) body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--tq-font);
  color: var(--tq-text);
  background: radial-gradient(1200px 600px at 10% -10%, rgba(var(--tq-primary-rgb), 0.35), transparent 55%),
    radial-gradient(900px 500px at 100% 0%, rgba(120, 80, 200, 0.2), transparent 50%),
    var(--tq-surface);
}

html:not(.tq-admin) a {
  color: #c4b5fd;
  text-decoration: none;
}
html:not(.tq-admin) a:hover {
  text-decoration: underline;
}

.tq-login {
  display: grid;
  min-height: 100vh;
  grid-template-columns: 1fr;
}

@media (min-width: 960px) {
  .tq-login {
    grid-template-columns: minmax(380px, 1fr) minmax(420px, 1.1fr);
  }
}

.tq-login__brand {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(1.5rem, 4vw, 3rem);
  background: linear-gradient(165deg, var(--tq-primary) 0%, #4a2888 55%, #2d1855 100%);
  position: relative;
  overflow: hidden;
}

.tq-login__brand::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 80%, rgba(255, 255, 255, 0.12), transparent 45%);
  pointer-events: none;
}

.tq-login__brand-inner {
  position: relative;
  z-index: 1;
  max-width: 420px;
  margin: 0 auto;
  text-align: center;
}

.tq-login__logo {
  width: 180px;
  height: auto;
  margin-bottom: 1.5rem;
  filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.25));
}

.tq-login__brand h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.tq-login__brand p {
  margin: 0;
  color: rgba(255, 255, 255, 0.88);
  font-size: 1rem;
  line-height: 1.6;
}

.tq-login__features {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.1rem;
  margin-top: 2.5rem;
}

.tq-login__feature {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 0.7rem;
  width: auto;
  max-width: 100%;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
}

.tq-login__feature-icon,
.tq-login__feature svg {
  display: block;
  width: 2rem !important;
  height: 2rem !important;
  max-width: 2rem;
  max-height: 2rem;
  flex: none;
}

.tq-login__panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(1.5rem, 4vw, 2.5rem);
}

/* Dark right-side / mobile wordmark: PNG is near-black, invert to light. */
.tq-login__mobile-brand {
  margin: 0 auto 1.5rem;
  color: var(--tq-text);
  text-align: center;
}

.tq-login__mobile-brand img,
.tq-login__logo--on-dark {
  width: 160px;
  height: auto;
  filter: brightness(0) invert(1);
}

.tq-login__mobile-brand #tq-product-name-mobile {
  display: block;
  margin-top: 0.4rem;
  color: var(--tq-muted);
  font-size: 0.9rem;
}

.tq-card {
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  background: var(--tq-card);
  border: 1px solid var(--tq-border);
  border-radius: var(--tq-radius);
  padding: clamp(1.25rem, 3vw, 2rem);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

.tq-card h2 {
  margin: 0 0 0.35rem;
  font-size: 1.35rem;
  font-weight: 600;
}

.tq-card .tq-sub {
  margin: 0 0 1.25rem;
  font-size: 0.9rem;
  color: var(--tq-muted);
}

.tq-methods {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.tq-method-btn {
  flex: 1 1 auto;
  min-width: 88px;
  padding: 0.5rem 0.65rem;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--tq-muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--tq-border);
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.tq-method-btn:hover {
  color: var(--tq-text);
  background: rgba(255, 255, 255, 0.07);
}

.tq-method-btn[aria-selected="true"] {
  color: #fff;
  background: rgba(var(--tq-primary-rgb), 0.35);
  border-color: rgba(var(--tq-primary-rgb), 0.6);
}

.tq-panel-section {
  display: none;
}

.tq-panel-section.is-active {
  display: block;
}

.tq-field {
  margin-bottom: 1rem;
}

.tq-field label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--tq-muted);
  margin-bottom: 0.35rem;
}

.tq-field input {
  width: 100%;
  padding: 0.65rem 0.85rem;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--tq-text);
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--tq-border);
  border-radius: 10px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.tq-field input:focus {
  border-color: var(--tq-primary);
  box-shadow: 0 0 0 3px rgba(var(--tq-primary-rgb), 0.25);
}

.tq-field input[readonly] {
  cursor: default;
  opacity: 0.92;
}

/* [hidden] must win over .tq-btn { display: inline-flex } */
.tq-btn[hidden] {
  display: none !important;
}

.tq-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.75rem 1rem;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  background: #6638b6;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}

.tq-btn:hover {
  background: var(--tq-primary-dark);
  color: #fff;
}

.tq-btn:active {
  transform: scale(0.99);
}

.tq-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  color: #fff;
}

.tq-btn--ghost {
  background: transparent;
  border: 1px solid var(--tq-border);
  color: var(--tq-text);
}

.tq-btn--ghost:hover {
  background: rgba(255, 255, 255, 0.06);
}

.tq-sso-wrap {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--tq-border);
}

.tq-sso-wrap p {
  margin: 0 0 0.65rem;
  font-size: 0.8rem;
  color: var(--tq-muted);
  text-align: center;
}

.tq-sso {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.tq-sso .tq-sso__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  width: 100%;
  margin: 0;
  padding: 0.7rem 1rem;
  font: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--tq-text);
  text-decoration: none;
  border-radius: 10px;
  border: 1px solid var(--tq-border);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.tq-sso .tq-sso__btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.08);
}

.tq-sso .tq-sso__btn:focus-visible {
  outline: 2px solid var(--tq-primary);
  outline-offset: 2px;
}

.tq-sso .tq-sso__btn.is-disabled,
.tq-sso .tq-sso__btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
  filter: grayscale(0.35);
}

.tq-sso svg {
  flex-shrink: 0;
}

.tq-sso__ms:hover {
  border-color: rgba(0, 120, 212, 0.5);
}

.tq-sso__google:hover {
  border-color: rgba(66, 133, 244, 0.45);
}

.tq-alert {
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  font-size: 0.85rem;
  margin-bottom: 1rem;
  display: none;
}

.tq-alert.is-visible {
  display: block;
}

.tq-alert--error {
  background: rgba(220, 38, 38, 0.15);
  border: 1px solid rgba(220, 38, 38, 0.35);
  color: #fecaca;
}

.tq-alert--success {
  background: rgba(22, 163, 74, 0.15);
  border: 1px solid rgba(22, 163, 74, 0.35);
  color: #bbf7d0;
}

.tq-lang {
  margin-top: 1.25rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--tq-muted);
}

.tq-lang a {
  color: var(--tq-muted);
}

.tq-lang a:hover {
  color: #c4b5fd;
}

.tq-lang__sep {
  margin: 0 0.35rem;
  opacity: 0.6;
}

.tq-foot {
  margin-top: 1.5rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--tq-muted);
}

.tq-foot a {
  color: var(--tq-muted);
}

.tq-spinner {
  width: 1.1rem;
  height: 1.1rem;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: tq-spin 0.7s linear infinite;
  display: none;
}

.tq-btn.is-loading .tq-spinner {
  display: inline-block;
}

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

.tq-hint {
  font-size: 0.78rem;
  color: var(--tq-muted);
  margin-top: 0.35rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
