/* Auth UI — avatar (every page header), sign-in form, callbacks.
 *
 * Color tokens mirror tailwind / mobile theme/tokens.ts:
 *   bg #0A0A0B / bg1 #111114 / bg2 #18181D
 *   fg #ECECEE / fg2 #BCBCC2 / fg3 #8B8B92
 *   border #1F1F25 / accent #B8FF3C / commentary #FF7A8E
 *   font-body Hanken Grotesk / font-mono JetBrains Mono
 */

/* ── Top-bar avatar ───────────────────────────────────────────── */

.avatar-host {
  display: flex;
  align-items: center;
  /* Spacing handled by .topbar-right flex `gap` in app.css —
     avoid double-margin overlap. */
}

/* Guest state — a small pill showing a silhouette + "Sign in" */
.avatar-guest {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border: 1px solid rgba(140, 140, 145, 0.30);
  border-radius: 999px;
  color: #BCBCC2;
  font-family: 'Hanken Grotesk', sans-serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.3px;
  text-decoration: none;
  background: transparent;
  transition: border-color 120ms, color 120ms, background 120ms;
}
.avatar-guest:hover {
  border-color: rgba(184, 255, 60, 0.45);
  color: #ECECEE;
  background: rgba(184, 255, 60, 0.05);
}
.avatar-guest-icon {
  display: inline-block;
  font-size: 14px;
  line-height: 1;
  color: #8B8B92;
}
.avatar-guest:hover .avatar-guest-icon { color: #B8FF3C; }
.avatar-guest-label {
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 1.2px;
  font-size: 10px;
  text-transform: uppercase;
}

/* Signed-in state — initial disc, opens a small menu on click */
.avatar-menu {
  position: relative;
}
.avatar-summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.avatar-summary::-webkit-details-marker { display: none; }

.avatar-disc {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(184, 255, 60, 0.10);
  border: 1.5px solid rgba(184, 255, 60, 0.55);
  color: #B8FF3C;
  font-family: 'Hanken Grotesk', sans-serif;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.3px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.avatar-menu-pop {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 220px;
  background: #111114;
  border: 1px solid #1F1F25;
  border-radius: 10px;
  padding: 6px;
  box-shadow: 0 16px 28px rgba(0, 0, 0, 0.55);
  z-index: 30;
}

.avatar-menu-email {
  padding: 8px 10px 10px;
  font-family: 'Hanken Grotesk', sans-serif;
  font-size: 12px;
  color: #8B8B92;
  border-bottom: 1px solid #1F1F25;
  margin-bottom: 4px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.avatar-menu-item {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  padding: 9px 10px;
  font-family: 'Hanken Grotesk', sans-serif;
  font-size: 13px;
  color: #ECECEE;
  text-decoration: none;
  border-radius: 6px;
  cursor: pointer;
}
.avatar-menu-item:hover { background: #18181D; }
.avatar-menu-form { margin: 0; }
.avatar-menu-danger { color: #FF7A8E; }

/* Pro tier marker — slightly thicker lime ring on the disc + a
   PRO chip in the dropdown. Subtle on purpose: it's a status,
   not a billboard. */
.avatar-disc-paid {
  border-color: #B8FF3C;
  box-shadow: 0 0 0 1px rgba(184, 255, 60, 0.18);
}

/* Anonymous flavor — same disc dimensions, neutral colors, no
   initial letter. Renders as a small person silhouette so the
   topbar always carries a profile affordance (matches the mobile
   avatar which is also always-visible). Click → /account, which
   surfaces the paywall + sign-in CTA. */
.avatar-disc-anon {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(140, 140, 145, 0.45);
  color: #8B8B92;
  text-decoration: none;
  transition: color 0.12s ease, border-color 0.12s ease,
              background-color 0.12s ease;
}
.avatar-disc-anon:hover {
  color: #ECECEE;
  border-color: rgba(184, 255, 60, 0.45);
  background: rgba(184, 255, 60, 0.06);
}
.avatar-disc-anon svg {
  width: 16px;
  height: 16px;
  display: block;
}
.avatar-menu-tier {
  display: inline-block;
  margin: 4px 10px 6px;
  padding: 2px 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9.5px;
  letter-spacing: 1.2px;
  color: #B8FF3C;
  background: rgba(184, 255, 60, 0.08);
  border: 1px solid rgba(184, 255, 60, 0.35);
  border-radius: 999px;
}

/* Topbar "Upgrade" pill — sits to the LEFT of the avatar when the
   signed-in user is on the free tier. Hidden in CSS for paid +
   guest states (the template already gates the markup). */
.upgrade-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border: 1px solid rgba(184, 255, 60, 0.40);
  border-radius: 999px;
  background: rgba(184, 255, 60, 0.10);
  color: #B8FF3C;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  text-decoration: none;
  transition: background 120ms, border-color 120ms;
}
.upgrade-pill:hover {
  background: rgba(184, 255, 60, 0.20);
  border-color: rgba(184, 255, 60, 0.65);
}
.upgrade-spark { font-size: 9px; line-height: 1; }
.upgrade-label { font-weight: 500; }


/* ── Account-page subscription section ────────────────────────
 * Lives in auth.css (not pricing.css) because /account is served
 * via base.html which only loads app.css + auth.css. */

.account-sub-card { padding: 18px 18px 18px; }
.account-sub-row {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  flex-wrap: wrap;
}
.account-sub-info { flex: 1 1 60%; min-width: 220px; }
.account-sub-actions { flex: 0 0 auto; align-self: center; }
.account-sub-tier {
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  letter-spacing: 1.6px;
  color: #B8FF3C;
  margin-bottom: 6px;
}
.account-sub-tier-free { color: #BCBCC2; }
.account-sub-via {
  color: #8B8B92;
  margin-left: 4px;
  font-size: 11px;
  letter-spacing: 1.2px;
}
.account-sub-meta {
  font-family: 'Hanken Grotesk', sans-serif;
  font-size: 13px;
  color: #8B8B92;
  line-height: 1.45;
}
.account-cta-btn {
  display: inline-flex;
  align-items: center;
  padding: 9px 16px;
  border: 1px solid rgba(184, 255, 60, 0.45);
  background: rgba(184, 255, 60, 0.10);
  color: #B8FF3C;
  border-radius: 999px;
  font-family: 'Hanken Grotesk', sans-serif;
  font-weight: 600;
  font-size: 13px;
  text-decoration: none;
  transition: background 120ms, border-color 120ms;
}
.account-cta-btn:hover {
  background: rgba(184, 255, 60, 0.20);
  border-color: rgba(184, 255, 60, 0.65);
}


/* ── Sign-in / check-email pages ──────────────────────────────── */

.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 18px;
  background: #0A0A0B;
}
.auth-card {
  width: 100%;
  max-width: 400px;
}
.auth-card-narrow {
  max-width: 400px;
  text-align: center;
}
.auth-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px; height: 56px;
  border-radius: 28px;
  background: rgba(184, 255, 60, 0.10);
  border: 1px solid rgba(184, 255, 60, 0.35);
  color: #B8FF3C;
  font-size: 24px;
  margin-bottom: 18px;
}
.auth-heading {
  font-family: 'Hanken Grotesk', sans-serif;
  font-weight: 700;
  font-size: 26px;
  letter-spacing: -0.4px;
  color: #ECECEE;
  margin: 0 0 8px;
}
.auth-sub {
  font-family: 'Hanken Grotesk', sans-serif;
  font-weight: 400;
  font-size: 13px;
  color: #BCBCC2;
  line-height: 20px;
  margin: 0 0 22px;
}

.auth-provider-btn {
  /* Flex row with the icon left of the label, both vertically
     centered and the pair as a whole horizontally centered.
     `gap` puts breathing room between glyph and text without a
     trailing space character that wraps weirdly on narrow widths. */
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  margin-bottom: 10px;
  padding: 13px 16px;
  border-radius: 10px;
  border: 1px solid rgba(140, 140, 145, 0.25);
  background: #111114;
  color: #ECECEE;
  font-family: 'Hanken Grotesk', sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-align: center;
  line-height: 1;
}
.auth-provider-icon {
  flex: 0 0 auto;
  display: block;
}
.auth-provider-btn:hover { background: #18181D; }
.auth-provider-muted { opacity: 0.65; }
.auth-provider-primary {
  border-color: rgba(184, 255, 60, 0.35);
  background: rgba(184, 255, 60, 0.10);
  color: #B8FF3C;
  font-weight: 700;
}
.auth-provider-primary:hover {
  background: rgba(184, 255, 60, 0.20);
}

.auth-divider {
  display: flex; align-items: center; gap: 10px;
  margin: 14px 0;
}
.auth-divider::before,
.auth-divider::after {
  content: ""; flex: 1;
  border-top: 1px solid #1F1F25;
}
.auth-divider span {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: #8B8B92;
}

.auth-email-form { display: block; }
.auth-label {
  display: block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: #8B8B92;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.auth-email-input {
  display: block;
  width: 100%;
  padding: 12px 14px;
  background: #111114;
  border: 1px solid rgba(140, 140, 145, 0.25);
  border-radius: 10px;
  color: #ECECEE;
  font-family: 'Hanken Grotesk', sans-serif;
  font-size: 14px;
  margin-bottom: 12px;
}
.auth-email-input:focus {
  outline: none;
  border-color: rgba(184, 255, 60, 0.55);
}
.auth-form-error {
  font-family: 'Hanken Grotesk', sans-serif;
  font-size: 12px;
  color: #FF7A8E;
  margin: 0 0 10px;
}

.auth-foot {
  margin-top: 22px;
  font-family: 'Hanken Grotesk', sans-serif;
  font-size: 12px;
  color: #8B8B92;
  text-align: center;
}
.auth-foot-link {
  color: #BCBCC2;
  text-decoration: none;
  border-bottom: 1px dotted #3a3a40;
}
.auth-foot-link:hover { color: #ECECEE; border-color: #ECECEE; }
.auth-foot-sep { color: #3a3a40; }


/* ── /account page ───────────────────────────────────────────── */

.account-page {
  max-width: 640px;
  /* Pull the page up close to the topbar so the hero + first card
     land above the fold on a typical viewport. */
  padding-top: 18px;
}
.account-anon-blurb {
  font-family: 'Hanken Grotesk', sans-serif;
  font-size: 14px;
  color: #BCBCC2;
  line-height: 22px;
  margin: 0 0 18px;
}

/* ── /account anon utility ───────────────────────────────────
 * Hero + read-only prefs card + legal footer. No upgrade pitch.
 * Selectors scoped under .account-anon-hero / .account-anon-prefs-*
 * so they out-specify .legal h1 / .legal ul / .legal a from app.css. */

.account-anon-hero {
  margin: 0 0 24px;
}
.account-anon-hero .account-anon-eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 2.6px;
  text-transform: uppercase;
  color: #8B8B92;
  margin: 0 0 10px;
}
.account-anon-hero .account-anon-headline {
  font-family: 'Hanken Grotesk', sans-serif;
  font-weight: 700;
  font-size: clamp(22px, 3.2vw, 28px);
  line-height: 1.15;
  letter-spacing: -0.4px;
  color: #ECECEE;
  margin: 0 0 8px;
  max-width: 22ch;
}
.account-anon-hero .account-anon-sub {
  font-family: 'Hanken Grotesk', sans-serif;
  font-size: 13.5px;
  line-height: 1.5;
  color: #BCBCC2;
  margin: 0 0 16px;
  max-width: 52ch;
}
.account-anon-hero .account-anon-cta-row {
  margin: 0;
}
/* Larger sign-in pill — this is the page's only action, so it
   carries more visual weight than the default .account-cta-btn. */
.account-anon-signin-primary {
  padding: 11px 24px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.account-anon-prefs-card {
  /* Inherit .account-card frame; scope overrides under this class. */
  padding: 14px 16px;
}
.account-anon-prefs-card .account-anon-prefs-list {
  list-style: none;
  padding: 0;
  margin: 10px 0 12px;
  border-top: 1px solid rgba(140, 140, 145, 0.12);
}
.account-anon-prefs-card .account-anon-prefs-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  padding: 9px 0;
  border-bottom: 1px solid rgba(140, 140, 145, 0.10);
}
.account-anon-prefs-card .account-anon-prefs-label {
  font-family: 'Hanken Grotesk', sans-serif;
  font-size: 13px;
  color: #BCBCC2;
}
.account-anon-prefs-card .account-anon-prefs-status {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 1.4px;
  color: #8B8B92;
  background: rgba(140, 140, 145, 0.10);
  border: 1px solid rgba(140, 140, 145, 0.22);
  border-radius: 999px;
  padding: 2px 9px;
  flex-shrink: 0;
}
.account-anon-prefs-card .account-anon-prefs-foot {
  font-family: 'Hanken Grotesk', sans-serif;
  font-size: 12.5px;
  color: #8B8B92;
  margin: 12px 0 0;
}

.account-anon-foot-legal {
  list-style: none;
  padding: 0;
  margin: 24px 0 0;
  display: flex;
  gap: 18px;
  font-family: 'Hanken Grotesk', sans-serif;
  font-size: 12.5px;
}
.account-anon-foot-legal li { margin: 0; }
.account-anon-foot-legal a {
  color: #8B8B92;
  text-decoration: none;
  border-bottom: 1px dotted #3a3a40;
}
.account-anon-foot-legal a:hover {
  color: #ECECEE;
  border-color: #ECECEE;
}

/* ── /account signed-in FREE upgrade promo ─────────────────
 * Dominant card on /account when an account exists but isn't paid.
 * Subtle lime-tinted frame + curated 4-bullet benefits subset →
 * primary CTA → /pricing for the full pitch + Stripe checkout. */

.account-upgrade-promo {
  background: linear-gradient(
    180deg,
    rgba(184, 255, 60, 0.04),
    rgba(184, 255, 60, 0.00)
  ), #111114;
  border: 1px solid rgba(184, 255, 60, 0.42);
  border-radius: 10px;
  padding: 18px 18px 16px;
  margin: 0 0 24px;
}
.account-upgrade-promo .account-upgrade-eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 2.4px;
  text-transform: uppercase;
  color: #B8FF3C;
  margin: 0 0 8px;
}
.account-upgrade-promo .account-upgrade-headline {
  font-family: 'Hanken Grotesk', sans-serif;
  font-weight: 700;
  font-size: clamp(20px, 2.8vw, 24px);
  line-height: 1.18;
  letter-spacing: -0.3px;
  color: #ECECEE;
  margin: 0 0 14px;
  max-width: 22ch;
}
.account-upgrade-promo .account-upgrade-bullets {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
  display: grid;
  gap: 8px;
}
.account-upgrade-promo .account-upgrade-bullets li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: start;
  margin: 0;
  font-family: 'Hanken Grotesk', sans-serif;
  font-size: 13.5px;
  line-height: 1.4;
  color: #BCBCC2;
}
.account-upgrade-promo .account-upgrade-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  border-radius: 999px;
  background: rgba(184, 255, 60, 0.10);
  border: 1px solid rgba(184, 255, 60, 0.42);
  color: #B8FF3C;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  line-height: 1;
  flex-shrink: 0;
}
.account-upgrade-promo .account-upgrade-cta {
  padding: 11px 22px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.2px;
}
.account-upgrade-promo .account-upgrade-foot {
  font-family: 'Hanken Grotesk', sans-serif;
  font-size: 12px;
  color: #8B8B92;
  margin: 12px 0 0;
}
.account-cta {
  display: inline-block;
  padding: 10px 20px;
  background: rgba(184, 255, 60, 0.10);
  border: 1px solid rgba(184, 255, 60, 0.35);
  color: #B8FF3C;
  border-radius: 10px;
  font-family: 'Hanken Grotesk', sans-serif;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.3px;
  text-decoration: none;
}
.account-cta:hover { background: rgba(184, 255, 60, 0.20); }

.account-card {
  background: #111114;
  border: 1px solid #1F1F25;
  border-radius: 10px;
  padding: 14px 16px;
  margin: 16px 0 24px;
}
.account-eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: #8B8B92;
  margin-bottom: 5px;
}
.account-email {
  font-family: 'Hanken Grotesk', sans-serif;
  font-size: 16px;
  font-weight: 500;
  color: #ECECEE;
}
.account-meta {
  margin-top: 6px;
  font-family: 'Hanken Grotesk', sans-serif;
  font-size: 12px;
  color: #8B8B92;
}

.account-section-h {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: #8B8B92;
  margin: 28px 0 12px;
}

.account-devices {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
  border-top: 1px solid rgba(140, 140, 145, 0.12);
}
.account-device-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(140, 140, 145, 0.12);
}
.account-device-info { flex: 1; }
.account-device-label {
  font-family: 'Hanken Grotesk', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: #ECECEE;
}
.account-device-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  letter-spacing: 1.4px;
  color: #B8FF3C;
  margin-left: 8px;
}
.account-device-meta {
  margin-top: 2px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: #8B8B92;
}
.account-device-form { margin: 0; }
.account-device-signout {
  background: transparent;
  border: 0;
  padding: 6px 10px;
  border-radius: 6px;
  font-family: 'Hanken Grotesk', sans-serif;
  font-size: 12px;
  color: #BCBCC2;
  cursor: pointer;
}
.account-device-signout:hover {
  background: #18181D;
  color: #ECECEE;
}

.account-footer-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}
.account-footer-form { flex: 1; margin: 0; }
.account-secondary-btn {
  display: block;
  width: 100%;
  padding: 11px 14px;
  background: #111114;
  border: 1px solid rgba(140, 140, 145, 0.25);
  border-radius: 10px;
  color: #BCBCC2;
  font-family: 'Hanken Grotesk', sans-serif;
  font-weight: 500;
  font-size: 13px;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}
.account-secondary-btn:hover { background: #18181D; color: #ECECEE; }
.account-danger-btn {
  display: block;
  width: 100%;
  padding: 11px 14px;
  background: rgba(255, 122, 142, 0.06);
  border: 1px solid rgba(255, 122, 142, 0.35);
  border-radius: 10px;
  color: #FF7A8E;
  font-family: 'Hanken Grotesk', sans-serif;
  font-weight: 500;
  font-size: 13px;
  text-align: center;
  cursor: pointer;
}
.account-danger-btn:hover { background: rgba(255, 122, 142, 0.15); }

.account-delete-status {
  margin-top: 12px;
  font-family: 'Hanken Grotesk', sans-serif;
  font-size: 12px;
  color: #FF7A8E;
}
