/* ── signup / sign-in gate — one look for every tool ─────────────────────────
 *
 * WHY THIS FILE EXISTS
 * --------------------
 * The first gate was functional but felt like a form from 2012: one mode with a
 * small "Sign in" link buried at the bottom, a password field with no way to
 * check what you typed, errors that appeared as loose text, and no way out if
 * you forgot the password. The owner's words: "password field is old and all is
 * bad looking and bad logic".
 *
 * This is the shared skin. Both implementations use it — assets/tool-gate.js
 * for the five tools, and the inline gate on /website-autopsy (which also
 * saves reports) — so a visitor sees one design and one set of behaviours
 * everywhere.
 *
 * Every colour is a token with a fallback, and every pair below was checked
 * against both themes (see the contrast gate, which renders these pages).
 */

.vx-gate {
  position: fixed;
  inset: 0;
  /* Sits above vx-wa-float (2147483000), consent bar (2147483000) and ai-chat (9998-9999), below .vx-skip (2147483647). */
  z-index: 2147483100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: var(--bg, #05030a);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
[data-theme="light"] .vx-gate { background: #f4f1fa; }
.vx-gate[hidden] { display: none !important; }

.vx-gate-card {
  /* border-box, not the default content-box, and this is load-bearing rather
   * than tidiness. width:100% plus 48px of horizontal padding under
   * content-box renders 48px WIDER than the parent: in the fixed overlay that
   * extra width is absorbed by the overlay's own scroll, but on
   * /reset-password the same card is the page inside a 16px-padded flex
   * container, so on a 390px phone it rendered 408px wide and the card and
   * its button were cut off the right edge. Measured: scrollWidth 424 against
   * a 390px viewport. There is no global box-sizing reset in the asset set,
   * so the card has to carry its own. */
  box-sizing: border-box;
  width: 100%;
  max-width: 430px;
  padding: 26px 24px 22px;
  border-radius: 20px;
  background: var(--surface, #131318);
  border: 1px solid rgba(139, 92, 246, 0.26);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.6);
  color: var(--text, #EDEDF2);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}
[data-theme="light"] .vx-gate-card {
  background: #fff;
  color: #14131a;
  border-color: rgba(106, 70, 232, 0.16);
  box-shadow: 0 28px 70px rgba(20, 19, 26, 0.14);
}

/* ── brand + tabs ────────────────────────────────────────────────────────── */
.vx-gate-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 18px;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--a-txt, #a78bfa);
}
[data-theme="light"] .vx-gate-brand { color: #5b21b6; }
.vx-gate-brand::before {
  content: "";
  width: 22px;
  height: 1px;
  background: currentColor;
  opacity: 0.6;
}

.vx-gate-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  margin: 0 0 18px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.07);
}
[data-theme="light"] .vx-gate-tabs {
  background: rgba(20, 19, 26, 0.04);
  border-color: rgba(20, 19, 26, 0.07);
}
.vx-gate-tab {
  appearance: none;
  border: 0;
  cursor: pointer;
  min-height: 40px;
  border-radius: 9px;
  background: transparent;
  color: var(--muted, #a9a6b8);
  font: 600 0.86rem/1 inherit;
  font-family: inherit;
  transition: background-color 0.18s ease, color 0.18s ease;
}
[data-theme="light"] .vx-gate-tab { color: #5b5966; }
.vx-gate-tab[aria-selected="true"] {
  background: #5b21b6;
  color: #fff;
}
[data-theme="light"] .vx-gate-tab[aria-selected="true"] { background: #5b21b6; color: #fff; }
.vx-gate-tab:focus-visible { outline: 2px solid #a78bfa; outline-offset: 2px; }

.vx-gate-h {
  font-size: 1.42rem;
  line-height: 1.2;
  margin: 0 0 6px;
  font-weight: 650;
  letter-spacing: -0.01em;
}
.vx-gate-p {
  font-size: 0.88rem;
  line-height: 1.5;
  margin: 0 0 18px;
  color: var(--muted, #a9a6b8);
}
[data-theme="light"] .vx-gate-p { color: #5b5966; }

/* ── fields ──────────────────────────────────────────────────────────────── */
.vx-field { margin: 0 0 14px; }
.vx-field label {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  margin: 0 0 6px;
  color: var(--muted, #a9a6b8);
}
[data-theme="light"] .vx-field label { color: #5b5966; }

.vx-input-wrap { position: relative; display: flex; }
.vx-field input {
  width: 100%;
  box-sizing: border-box;
  min-height: 48px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  color: inherit;
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.16s ease, background-color 0.16s ease;
}
[data-theme="light"] .vx-field input {
  background: #faf9fc;
  border-color: rgba(20, 19, 26, 0.16);
}
.vx-field input::placeholder { color: var(--muted, #a9a6b8); opacity: 0.75; }
[data-theme="light"] .vx-field input::placeholder { color: #8b8996; }
.vx-field input:focus {
  outline: none;
  border-color: #8b5cf6;
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.22);
}
.vx-field input[aria-invalid="true"] {
  border-color: #f87171;
  box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.16);
}

/* password reveal */
.vx-reveal {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted, #a9a6b8);
  cursor: pointer;
}
[data-theme="light"] .vx-reveal { color: #5b5966; }
.vx-reveal:hover { background: rgba(255, 255, 255, 0.06); }
[data-theme="light"] .vx-reveal:hover { background: rgba(20, 19, 26, 0.06); }
.vx-reveal:focus-visible { outline: 2px solid #8b5cf6; outline-offset: 1px; }
.vx-input-wrap input { padding-right: 50px; }

.vx-hint {
  margin: 6px 0 0;
  font-size: 0.78rem;
  line-height: 1.35;
  color: var(--muted, #a9a6b8);
  min-height: 1.1em;
}
[data-theme="light"] .vx-hint { color: #5b5966; }
.vx-hint[data-tone="bad"] { color: #ff9b9b; }
[data-theme="light"] .vx-hint[data-tone="bad"] { color: #b3261e; }

/* ── actions ─────────────────────────────────────────────────────────────── */
.vx-gate-btn {
  position: relative;
  width: 100%;
  min-height: 48px;
  margin: 4px 0 0;
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  background: linear-gradient(135deg, #7c3aed, #5b21b6);
  color: #fff;
  font: 600 0.95rem/1 inherit;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: filter 0.16s ease, transform 0.16s ease;
}
.vx-gate-btn:hover { filter: brightness(1.08); }
.vx-gate-btn:active { transform: translateY(1px); }
.vx-gate-btn[disabled] { opacity: 0.7; cursor: default; filter: none; }
.vx-gate-btn:focus-visible { outline: 2px solid #c4b5fd; outline-offset: 2px; }
.vx-gate-btn .vx-spin {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #fff;
  animation: vxspin 0.7s linear infinite;
  display: none;
}
.vx-gate-btn[data-busy="true"] .vx-spin { display: block; }
@keyframes vxspin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .vx-gate-btn .vx-spin { animation-duration: 2s; } }

.vx-gate-or {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0 14px;
  font-size: 0.76rem;
  color: var(--muted, #a9a6b8);
}
[data-theme="light"] .vx-gate-or { color: #5b5966; }
.vx-gate-or::before,
.vx-gate-or::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.14);
}
[data-theme="light"] .vx-gate-or::before,
[data-theme="light"] .vx-gate-or::after { background: rgba(20, 19, 26, 0.14); }

.vx-gate-g {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.03);
  color: inherit;
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 600;
}
[data-theme="light"] .vx-gate-g {
  border-color: rgba(20, 19, 26, 0.16);
  background: #fff;
}
.vx-gate-g:hover { background: rgba(255, 255, 255, 0.07); }
[data-theme="light"] .vx-gate-g:hover { background: #f6f4fb; }
.vx-gate-g[hidden] { display: none !important; }

.vx-gate-foot {
  margin: 16px 0 0;
  font-size: 0.78rem;
  line-height: 1.5;
  text-align: center;
  color: var(--muted, #a9a6b8);
}
[data-theme="light"] .vx-gate-foot { color: #5b5966; }
.vx-gate-foot a { color: var(--a-txt, #a78bfa); text-decoration: underline; text-underline-offset: 2px; }
[data-theme="light"] .vx-gate-foot a { color: #5b21b6; }
.vx-gate-foot a:focus-visible { outline: 2px solid #8b5cf6; outline-offset: 2px; }
