/* Sign-in screens and onboarding wizard (account.js) */
.tj-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: var(--panel-2);
  overflow-y: auto;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 56px 16px 40px;
}
.tj-overlay[hidden] { display: none; }

.tj-box {
  width: 100%;
  max-width: 420px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  box-shadow: 0 12px 40px rgba(16, 32, 31, 0.08);
}
.tj-box.wide { max-width: 640px; }

.tj-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
}
.tj-brand .torque-tile { width: 34px; height: 34px; border-radius: 9px; }
.tj-brand-name { font-weight: 700; font-size: 15px; }
.tj-brand-sub { font-size: 12px; color: var(--muted); }

.tj-box h2 {
  font-size: 28px;
  line-height: 1.15;
  margin-bottom: 6px;
}
.tj-lead { color: var(--muted); font-size: 13.5px; margin-bottom: 20px; }

.tj-form { display: flex; flex-direction: column; gap: 14px; }
.tj-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tj-form .field input, .tj-form .field select, .tj-form .field textarea { font-size: 14px; }
.tj-form .btn-primary { padding: 11px 16px; font-size: 14px; }
.tj-form .btn-primary:disabled { opacity: 0.6; cursor: default; }

.tj-links {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
  margin-top: 4px;
}
.tj-link {
  background: none;
  border: none;
  padding: 0;
  color: var(--accent);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.tj-link:hover { text-decoration: underline; }

.tj-msg { font-size: 13px; border-radius: 9px; padding: 9px 12px; }
.tj-msg:empty { display: none; }
.tj-msg.error { background: var(--bad-soft); color: var(--bad); }
.tj-msg.info { background: var(--accent-soft); color: var(--accent); }

.tj-code {
  letter-spacing: 0.4em;
  font-size: 20px !important;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

/* Wizard */
.tj-steps {
  display: flex;
  gap: 6px;
  margin-bottom: 18px;
}
.tj-steps span {
  flex: 1;
  height: 4px;
  border-radius: 4px;
  background: var(--border);
}
.tj-steps span.on { background: var(--accent); }
.tj-step-label { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 4px; }

.tj-drop {
  border: 1.5px dashed var(--border-strong);
  border-radius: 12px;
  padding: 26px 16px;
  text-align: center;
  background: var(--panel-2);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.tj-drop:hover, .tj-drop.over { border-color: var(--accent); background: var(--accent-soft); }
.tj-drop strong { display: block; font-size: 14px; margin-bottom: 4px; }
.tj-drop span { font-size: 12.5px; color: var(--muted); }
.tj-drop.has-file strong { color: var(--accent); }

.tj-or {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}
.tj-or::before, .tj-or::after { content: ''; flex: 1; height: 1px; background: var(--border); }

.tj-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
}

.tj-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 30px 0 18px;
  text-align: center;
  color: var(--muted);
}
.tj-spinner {
  width: 34px;
  height: 34px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: tjSpin 0.8s linear infinite;
}
@keyframes tjSpin { to { transform: rotate(360deg); } }

.tj-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tj-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 999px;
  padding: 4px 6px 4px 11px;
  font-size: 12.5px;
  font-weight: 600;
}
.tj-chip button {
  border: none;
  background: none;
  color: inherit;
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
  padding: 2px 4px;
  border-radius: 50%;
}
.tj-chip button:hover { background: rgba(31, 92, 82, 0.12); }
.tj-chip-add { display: flex; gap: 8px; margin-top: 8px; }
.tj-chip-add input { flex: 1; }

.tj-found {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.tj-found div {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
}
.tj-found b { display: block; font-size: 18px; }
.tj-found span { font-size: 12px; color: var(--muted); }

.tj-check { display: flex; gap: 9px; align-items: flex-start; font-size: 13px; }
.tj-check input { margin-top: 3px; accent-color: var(--accent); }

/* Account box in the sidebar */
.sidebar-account {
  margin-top: auto;
  border-top: 1px solid var(--sidebar-border);
  padding: 14px 6px 0;
  font-size: 12.5px;
  color: var(--sidebar-muted);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sidebar-account { position: relative; }
.sidebar-account button {
  background: none;
  border: none;
  padding: 0;
  color: var(--sidebar-icon);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.sidebar-account .acct-toggle {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 6px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.05);
  text-align: left;
}
.sidebar-account .acct-toggle:hover,
.sidebar-account.open .acct-toggle { background: rgba(255, 255, 255, 0.09); }
.sidebar-account .acct-avatar {
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #9cdb83;
  color: #142428;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
}
.sidebar-account .acct-name { flex: 1; min-width: 0; color: #fff; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-account .acct-chevron { flex: none; color: var(--sidebar-muted); transform: rotate(180deg); transition: transform 0.15s; }
.sidebar-account.open .acct-chevron { transform: none; }
.sidebar-account .acct-menu {
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: calc(100% - 8px);
  z-index: 20;
  padding: 6px;
  border-radius: 10px;
  background: #1b3130;
  border: 1px solid var(--sidebar-border);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
}
.sidebar-account .acct-menu[hidden] { display: none; }
.sidebar-account .acct-menu-email { color: var(--sidebar-muted); font-size: 11.5px; padding: 4px 8px 6px; overflow-wrap: anywhere; }
.sidebar-account .acct-menu button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 8px;
  border-radius: 7px;
  color: #e9efe9;
  font-weight: 500;
}
.sidebar-account .acct-menu button:hover,
.sidebar-account .acct-menu button:focus-visible { background: rgba(255, 255, 255, 0.08); color: #fff; outline: none; }
.sidebar-account .acct-setup {
  background: var(--sidebar-active);
  color: #fff;
  border-radius: 8px;
  padding: 8px 10px;
  text-align: left;
}

@media (max-width: 560px) {
  .tj-box { padding: 22px 18px; }
  .tj-row, .tj-found { grid-template-columns: 1fr; }
}

/* Code screens: spam hint; loading state after sign-in */
.tj-spam-hint {
  margin: -4px 0 0;
  padding: 9px 12px;
  border-radius: 8px;
  background: var(--warn-soft);
  color: var(--text);
  font-size: 12.5px;
  line-height: 1.45;
}
.tj-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 28px 0 8px;
  color: var(--muted);
  font-size: 14px;
}
.tj-spinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  border-top-color: var(--accent);
  animation: tj-spin 0.8s linear infinite;
}
@keyframes tj-spin {
  to { transform: rotate(360deg); }
}

/* Choose your plan (after setup) */
.tj-box.plans {
  max-width: 760px;
}
.tj-plan-now {
  display: inline-block;
  margin-right: 6px;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12.5px;
  font-weight: 700;
}
.tj-plans {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  margin-top: 16px;
}
.tj-plan {
  display: flex;
  flex-direction: column;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel);
}
.tj-plan.pro {
  border: 2px solid var(--accent);
}
.tj-plan-name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 15px;
}
.tj-plan-current {
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}
.tj-plan-price {
  font-family: var(--font-heading);
  font-size: 34px;
  line-height: 1;
  margin: 10px 0 4px;
}
.tj-plan-price small {
  font-family: inherit;
  font-size: 13px;
  color: var(--muted);
}
.tj-plan .plan-period {
  margin-top: 10px;
}
.tj-plan-note {
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
}
.tj-plan .plan-list {
  margin: 12px 0 16px;
  font-size: 13px;
  gap: 7px;
}
.tj-plan button {
  width: 100%;
  margin-top: auto;
}
.tj-plan-foot {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}
