/* ============================================================================
   Convex Nexus Capital — auth surface (login / register / pending / admin)
   ----------------------------------------------------------------------------
   Loaded AFTER style.css on every auth page, so it inherits the design tokens
   declared there (:root --bg/--text/--accent/--r-*/--shadow*/--font …) and only
   adds layout + copy chrome specific to the sign-in flow. Standard CSS only,
   no @import, no external origin — served from /static so it satisfies the
   page CSP (style-src 'self'; inline <style> is NOT allowed by that policy,
   which is exactly why this lives in its own file).
   ========================================================================== */

/* ----------------------------------------------------------------------------
   Centred page frame (login / register / pending)
   -------------------------------------------------------------------------- */
body.auth-body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
}

.auth-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 40px 18px;
}

/* ----------------------------------------------------------------------------
   The card
   -------------------------------------------------------------------------- */
.auth-card {
  position: relative;
  width: 100%;
  max-width: 408px;
  padding: 32px 30px 26px;
  border-radius: var(--r-lg);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0)),
    var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
}
/* faint top-edge sheen, matching the dashboard panels */
.auth-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.14), transparent);
  pointer-events: none;
}
.auth-card-message { text-align: center; }

/* ----------------------------------------------------------------------------
   Brand lockup
   -------------------------------------------------------------------------- */
.auth-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin-bottom: 22px;
  text-align: center;
}
.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  margin-bottom: 6px;
  border-radius: 13px;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #052420;
  background: conic-gradient(from 210deg, var(--accent), var(--accent-2), var(--accent));
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.12) inset,
    0 6px 18px var(--accent-glow);
}
.brand-name {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
  line-height: 1.2;
}
.brand-tagline {
  margin: 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--text-mute);
}

/* ----------------------------------------------------------------------------
   Headings
   -------------------------------------------------------------------------- */
.auth-title {
  text-align: center;
  font-size: 19px;
  font-weight: 680;
  letter-spacing: -0.01em;
  color: var(--text);
  margin: 0 0 18px;
}
/* When an intro line follows the title, pull the title's bottom gap in so the
   two read as one block. */
.auth-title + .auth-subtext { margin-top: -10px; margin-bottom: 18px; }

/* ----------------------------------------------------------------------------
   Form layout
   -------------------------------------------------------------------------- */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}
.form-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.form-field label {
  display: block;
  margin: 0;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-mute);
}
.form-optional {
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--text-faint);
}
.form-field input {
  width: 100%;
  font: inherit;
  font-size: 14px;
  color: var(--text);
  background: rgba(8, 12, 19, 0.65);
  border: 1px solid var(--border-str);
  border-radius: var(--r-sm);
  padding: 11px 13px;
  transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}
.form-field input::placeholder { color: var(--text-faint); }
.form-field input:hover { border-color: rgba(148, 170, 205, 0.32); }
.form-field input:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(8, 12, 19, 0.85);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.form-field input:-webkit-autofill {
  -webkit-text-fill-color: var(--text);
  -webkit-box-shadow: 0 0 0 1000px rgba(13, 18, 28, 0.95) inset;
  caret-color: var(--text);
}
.form-hint {
  font-size: 11px;
  color: var(--text-faint);
  line-height: 1.4;
}

/* ----------------------------------------------------------------------------
   Inline status messages (auth.js toggles [hidden] + .is-error/.is-ok)
   -------------------------------------------------------------------------- */
.form-error,
.form-ok {
  font-size: 12.5px;
  font-weight: 550;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  line-height: 1.4;
  margin: 0;
}
.form-error {
  color: #fecaca;
  background: var(--neg-soft);
  border-color: rgba(248, 113, 113, 0.32);
}
.form-error::before { content: "\26A0  "; }     /* ⚠ */
.form-ok {
  color: #bbf7e6;
  background: var(--accent-soft);
  border-color: rgba(45, 212, 191, 0.30);
}
.form-ok::before { content: "\2713  "; }         /* ✓ */
/* Respect the hidden attribute auth.js sets when a message is empty. */
.form-error[hidden],
.form-ok[hidden] { display: none; }

/* ----------------------------------------------------------------------------
   Submit / action buttons
   -------------------------------------------------------------------------- */
.auth-submit {
  width: 100%;
  margin-top: 3px;
  padding: 12px 18px;
}
/* the disabled/busy state auth.js drives via [disabled] + aria-busy */
.auth-submit[aria-busy="true"] { cursor: progress; }

/* ----------------------------------------------------------------------------
   Notices + footer links
   -------------------------------------------------------------------------- */
.auth-notice {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin: 16px 0 0;
  padding: 11px 13px;
  border-radius: var(--r-sm);
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--border-soft);
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-dim);
}
.auth-notice::before {
  content: "\1F512";                /* lock glyph */
  flex: 0 0 auto;
  font-size: 12px;
  line-height: 1.45;
  opacity: 0.9;
}

.auth-foot {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border-soft);
  text-align: center;
  font-size: 12.5px;
  color: var(--text-mute);
}
.auth-foot p { margin: 0; }
.auth-link { font-weight: 600; }

/* The card-message footer (pending) holds a full-width "back" button. */
.auth-card-message .auth-foot {
  border-top: 0;
  padding-top: 0;
  margin-top: 22px;
}
.auth-card-message .auth-submit { display: inline-flex; }

/* ----------------------------------------------------------------------------
   Pending / message state
   -------------------------------------------------------------------------- */
.auth-status-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  margin: 4px auto 14px;
  border-radius: 50%;
  font-size: 26px;
  line-height: 1;
  color: var(--warn);
  background: var(--warn-soft);
  border: 1px solid rgba(251, 191, 36, 0.32);
}
.auth-message {
  margin: 0 auto;
  max-width: 34ch;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--text-dim);
}
.auth-subtext {
  margin: 12px auto 0;
  max-width: 34ch;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-mute);
}

/* ----------------------------------------------------------------------------
   Mobile
   -------------------------------------------------------------------------- */
@media (max-width: 480px) {
  .auth-wrap { padding: 24px 14px; }
  .auth-card { padding: 26px 20px 22px; }
  .brand-mark { width: 42px; height: 42px; }
}

/* ============================================================================
   ADMIN approval console
   ----------------------------------------------------------------------------
   auth.js builds each row at runtime:
     <li class="user-row" data-email data-status>
       <div class="user-row__main">
         <span class="user-row__name">…</span>
         <span class="user-row__email">…</span>
       </div>
       <div class="user-row__meta">
         <span class="user-row__when" title>…</span>
         <span class="user-row__ip">IP …</span>
         <span class="user-row__ua" title>…</span>
         <span class="user-row__badge badge--<status>">status</span>
       </div>
       <div class="user-row__actions">            (pending only)
         <button class="btn btn--approve">Approve</button>
         <button class="btn btn--reject">Reject</button>
       </div>
     </li>
   plus a <li class="user-row user-row--empty"> placeholder when a list is empty.
   Everything below styles those generated nodes — the markup is owned by auth.js
   and must not change here.
   ========================================================================== */

/* Page chrome ------------------------------------------------------------- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 8px 14px;
  border-radius: 0 0 var(--r-sm) 0;
  background: var(--accent);
  color: #052420;
  font-weight: 650;
}
.skip-link:focus {
  left: 0;
  color: #052420;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: var(--topbar-h);
  padding: 10px 24px;
  background: linear-gradient(180deg, rgba(13, 18, 28, 0.92), rgba(11, 15, 23, 0.80));
  backdrop-filter: saturate(150%) blur(14px);
  -webkit-backdrop-filter: saturate(150%) blur(14px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 8px 24px rgba(0, 0, 0, 0.28);
}
.topbar .brand {
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--text);
  white-space: nowrap;
}
.topbar .brand::before {
  content: "";
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: conic-gradient(from 210deg, var(--accent), var(--accent-2), var(--accent));
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.10) inset, 0 0 16px var(--accent-glow);
  flex: 0 0 auto;
}
.topbar .brand .sub {
  font-weight: 600;
  color: var(--text-mute);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.topbar .nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0 auto;
  padding: 4px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-soft);
}
.topbar .nav a {
  display: inline-flex;
  align-items: center;
  padding: 7px 14px;
  border-radius: var(--r-pill);
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 550;
  line-height: 1;
  white-space: nowrap;
  transition: background-color .15s ease, color .15s ease;
}
.topbar .nav a:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }

.topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-left: auto;
  white-space: nowrap;
}
.topbar-right .user-email {
  font-size: 12.5px;
  color: var(--text-dim);
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.topbar-right .user-email:not(:empty)::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
  vertical-align: middle;
}

/* Status / stream banner -------------------------------------------------- */
.streambar {
  max-width: 1160px;
  margin: 14px auto 0;
  padding: 0 24px;
  min-height: 18px;
  font-size: 12.5px;
  font-weight: 550;
  color: var(--text-mute);
}
.streambar:empty { display: none; }
.streambar.is-error { color: var(--neg); }
.streambar.is-ok    { color: var(--accent); }
.streambar.is-busy  { color: var(--text-dim); }

/* Layout ------------------------------------------------------------------ */
main.admin {
  max-width: 1160px;
  margin: 0 auto;
  padding: 22px 24px 56px;
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

main.admin .panel {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px 22px 22px;
  border-radius: var(--r-lg);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0)),
    var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
main.admin .panel-h {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
main.admin .panel-h .title {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 15.5px;
  font-weight: 680;
  letter-spacing: -0.012em;
  color: var(--text);
  margin: 0 auto 0 0;
}
main.admin .panel-h .title::before {
  content: "";
  width: 3px;
  height: 15px;
  border-radius: var(--r-pill);
  background: linear-gradient(180deg, var(--accent), var(--accent-deep));
  box-shadow: 0 0 8px var(--accent-glow);
  flex: 0 0 auto;
}
/* Tint the section ticks so pending/approved/rejected read at a glance. */
#section-approved .panel-h .title::before {
  background: linear-gradient(180deg, var(--pos), #1f9d72);
  box-shadow: 0 0 8px var(--pos-soft);
}
#section-rejected .panel-h .title::before {
  background: linear-gradient(180deg, var(--neg), #b54a4a);
  box-shadow: 0 0 8px var(--neg-soft);
}

main.admin .note {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-mute);
}

/* The three lists --------------------------------------------------------- */
.user-list {
  list-style: none;
  margin: 4px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.user-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "main    actions"
    "meta    actions";
  align-items: center;
  gap: 4px 16px;
  padding: 13px 15px;
  border-radius: var(--r-md);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0)),
    var(--surface-3);
  border: 1px solid var(--border-soft);
  transition: border-color .15s ease, background-color .15s ease;
}
.user-row:hover { border-color: var(--border); }

.user-row__main {
  grid-area: main;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  min-width: 0;
}
.user-row__name {
  font-size: 14px;
  font-weight: 650;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
.user-row__email {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-dim);
  word-break: break-all;
}

.user-row__meta {
  grid-area: meta;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  font-size: 11.5px;
  color: var(--text-mute);
  min-width: 0;
}
.user-row__when { color: var(--text-mute); }
.user-row__ip { font-variant-numeric: tabular-nums; }
.user-row__ua {
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-faint);
}

/* Status badge auth.js stamps: <span class="user-row__badge badge--<status>"> */
.user-row__badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: 0.03em;
  text-transform: capitalize;
  line-height: 1;
  border: 1px solid var(--border-soft);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-dim);
}
.user-row__badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex: 0 0 auto;
}
.badge--approved,
.badge--admin   { color: var(--pos);  background: var(--pos-soft);  border-color: rgba(52, 211, 153, 0.30); }
.badge--pending { color: var(--warn); background: var(--warn-soft); border-color: rgba(251, 191, 36, 0.30); }
.badge--rejected { color: var(--neg); background: var(--neg-soft);  border-color: rgba(248, 113, 113, 0.30); }

/* Action buttons (auth.js: .btn.btn--approve / .btn.btn--reject) ---------- */
.user-row__actions {
  grid-area: actions;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
.user-row__actions .btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: inherit;
  font-size: 12.5px;
  font-weight: 640;
  line-height: 1;
  padding: 8px 15px;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: filter .15s ease, transform .08s ease, background-color .15s ease,
              color .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.user-row__actions .btn:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
.user-row__actions .btn:active { transform: translateY(1px); }
.user-row__actions .btn:disabled { opacity: 0.55; cursor: progress; filter: none; }

.btn--approve {
  color: #052420;
  background: linear-gradient(180deg, var(--accent), #1cb6a3);
  box-shadow: 0 3px 12px var(--accent-glow), 0 1px 0 rgba(255, 255, 255, 0.25) inset;
}
.btn--approve:hover:not(:disabled) { filter: brightness(1.07); }

.btn--reject {
  color: var(--neg);
  background: var(--neg-soft);
  border-color: rgba(248, 113, 113, 0.35);
}
.btn--reject:hover:not(:disabled) {
  color: #fff;
  background: var(--danger);
  border-color: var(--danger);
}

/* Empty-state placeholder (<li class="user-row user-row--empty">) --------- */
.user-row--empty {
  display: block;
  grid-template-columns: none;
  padding: 16px 15px;
  text-align: center;
  color: var(--text-mute);
  font-size: 12.5px;
  font-style: italic;
  background: rgba(255, 255, 255, 0.02);
  border-style: dashed;
}
.user-row--empty:hover { border-color: var(--border-soft); }

/* Footer ------------------------------------------------------------------ */
.footer {
  max-width: 1160px;
  margin: 8px auto 0;
  padding: 0 24px 28px;
  font-size: 11.5px;
  color: var(--text-faint);
  text-align: center;
}

/* Admin mobile ------------------------------------------------------------ */
@media (max-width: 720px) {
  .topbar { flex-wrap: wrap; gap: 10px; padding: 10px 16px; }
  .topbar .nav { order: 3; width: 100%; margin: 0; justify-content: center; }
  .topbar-right { margin-left: auto; }
  main.admin { padding: 18px 14px 48px; }
  .streambar { padding: 0 16px; }
  .footer { padding: 0 16px 24px; }

  .user-row {
    grid-template-columns: 1fr;
    grid-template-areas:
      "main"
      "meta"
      "actions";
    gap: 9px;
  }
  .user-row__actions { justify-content: stretch; }
  .user-row__actions .btn { flex: 1 1 0; }
  .user-row__ua { max-width: 100%; }
}

@media (max-width: 420px) {
  .topbar-right .user-email { display: none; }
}
