/* Sign in, register, reset password, sign out.
   These routes render without the app chrome (see app.js → renderRoute), so the
   card is the whole page and has to centre itself in the viewport. */

/* The header is removed rather than hidden: every control in it — search, bell,
   watchlist, account — leads somewhere that requires a session. */
body.chromeless .appbar { display: none; }
body.chromeless .view {
  max-width: none;
  padding: 24px 20px;
  display: grid;
  place-items: center;
}

.auth-page {
  width: 100%;
  max-width: 420px;
  display: grid;
  justify-items: center;
  gap: 16px;
}

.auth-card {
  width: 100%;
  padding: 28px 26px 24px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  box-shadow: var(--shadow-pop);
  text-align: center;
}

.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  color: var(--accent);
}
.auth-brand .brand-name { font-size: 18px; font-weight: 700; color: var(--ink); }
.auth-brand .brand-name em { font-style: normal; color: var(--accent); }

.auth-card h1 { font-size: 22px; margin: 0 0 6px; }
.auth-sub { font-size: 13.5px; color: var(--ink-muted); margin: 0 0 20px; }

/* A standing condition rather than a failure — accounts are switched off in
   config. Distinct from .auth-error, which reports something that just went wrong. */
.auth-note {
  padding: 10px 12px;
  margin-bottom: 16px;
  border-radius: var(--radius-sm);
  background: var(--muted-wash);
  color: var(--ink-2);
  font-size: 12.5px;
}

/* ---------- OAuth ---------- */

.auth-oauth {
  width: 100%;
  justify-content: center;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
}
/* The Google mark is a fixed, multi-colour asset — it must not take currentColor
   the way every other icon in .btn does. */
.auth-oauth .g-icon { width: 18px; height: 18px; }

/* A rule with the word sitting in a gap in it. */
.auth-or {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0;
  color: var(--ink-muted);
  font-size: 12px;
}
.auth-or::before, .auth-or::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--hairline);
}

/* ---------- Form ---------- */

/* The labels above the fields read left-to-right; only the card is centred. */
.auth-card .form-grid { text-align: left; }

.auth-password { position: relative; }
.auth-password input { padding-right: 42px; }
/* Hide the browser's own password-reveal control (Edge/IE on Windows) so it
   doesn't sit beside our custom .auth-eye as a duplicate second eye. */
.auth-password input::-ms-reveal,
.auth-password input::-ms-clear { display: none; }
.auth-eye {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--ink-muted);
  cursor: pointer;
}
.auth-eye:hover { background: var(--muted-wash); color: var(--ink); }
.auth-eye.is-on { color: var(--accent); }

.auth-error {
  margin: 0;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  background: var(--sell-wash);
  color: var(--sell);
  font-size: 12.5px;
  text-align: left;
}

/* Cloudflare Turnstile drops in its own ~300×65 iframe; just centre it and
   reserve the height so the card doesn't jump when it loads. */
.auth-turnstile {
  display: flex;
  justify-content: center;
  min-height: 65px;
}

.auth-submit {
  width: 100%;
  justify-content: center;
  margin-top: 4px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
}
.auth-submit.is-busy { opacity: 0.7; cursor: progress; }
.auth-submit:disabled { cursor: not-allowed; }

.auth-link {
  display: inline-block;
  margin-top: 14px;
  font-size: 12.5px;
  color: var(--ink-muted);
}
.auth-link:hover { color: var(--accent); }

.auth-alt {
  margin: 14px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--hairline);
  font-size: 13px;
  color: var(--ink-muted);
}
.auth-alt a { color: var(--accent); font-weight: 600; }

.auth-legal {
  max-width: 340px;
  margin: 0;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--ink-muted);
  text-align: center;
}

/* ---------- "Check your inbox" ---------- */

.auth-sent-icon { font-size: 34px; line-height: 1; margin-bottom: 10px; }
.auth-sent h2 { font-size: 19px; margin: 0 0 6px; }
.auth-sent p { font-size: 13.5px; color: var(--ink-muted); margin: 0 0 4px; }
.auth-sent-to { font-weight: 600; color: var(--ink) !important; margin-bottom: 18px !important; }

/* ---------- Sign out ---------- */

.signout-who {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px;
  margin-bottom: 16px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  background: var(--page);
}
.signout-email {
  font-size: 13.5px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Cancel is the safe choice, so it is the quiet one — same size, no fill. */
.auth-cancel { margin-top: 8px; }

/* ---------- Account row in the header menu ---------- */

.menu-account {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 11px;
  margin: 2px 2px 6px;
  border-radius: 12px;
  text-align: left;
  /* Tier-tinted card. `--acct` is the tier's accent as raw RGB channels (set below
     by [data-tier]); a faint gradient fill + a matching hairline give the box the
     same silver/gold/diamond identity as the profile header and plans page. */
  border: 1px solid rgba(var(--acct, 148, 163, 184), 0.32);
  background: linear-gradient(180deg,
    rgba(var(--acct, 148, 163, 184), 0.12),
    rgba(var(--acct, 148, 163, 184), 0.03));
}
.menu-account[data-tier="silver"]  { --acct: 148, 163, 184; }
.menu-account[data-tier="gold"]    { --acct: 234, 179, 8; }
.menu-account[data-tier="diamond"] { --acct: 56, 189, 248; }

.menu-account-avatar {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-2, rgba(255, 255, 255, 0.06));
  color: var(--ink-muted);
  box-shadow: 0 0 0 2px rgba(var(--acct, 148, 163, 184), 0.5);
}
.menu-account-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.menu-account-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.menu-account-name {
  font-size: 13.5px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* Small subscription label under the name, in the tier's colour, led by a little
   gem-shaped dot. Colours mirror .plan-tag-* so the two read as the same badge. */
.menu-account-plan {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #64748b;
}
.menu-account-plan::before {
  content: "";
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 2px;
  transform: rotate(45deg);
  background: rgb(var(--acct, 148, 163, 184));
}
.menu-account[data-tier="gold"]    .menu-account-plan { color: #b45309; }
.menu-account[data-tier="diamond"] .menu-account-plan { color: #0369a1; }
:root[data-theme="dark"] .menu-account[data-tier="silver"]  .menu-account-plan { color: #cbd5e1; }
:root[data-theme="dark"] .menu-account[data-tier="gold"]    .menu-account-plan { color: #fcd34d; }
:root[data-theme="dark"] .menu-account[data-tier="diamond"] .menu-account-plan { color: #7dd3fc; }
