/* ==============================================================
   PBICompass shared design system — liquid glass over motion
   strict grayscale · Poppins · Source Serif 4 italic accents
   Extracted (Day 33) from index.html so / and /app render as one
   product instead of two visually unrelated pages. Page-specific
   layout (hero, marketing sections, app-shell nav, etc.) stays in
   each page's own <style> block — only the shared tokens and
   component primitives live here.
   ============================================================== */
:root {
  /* grayscale-only tokens (0 0% X%) */
  --background: hsl(160 24% 10%);
  --foreground: hsl(0 0% 100%);
  --muted: hsl(0 0% 100% / .8);
  --muted-2: hsl(0 0% 100% / .72);
  --soft: hsl(0 0% 100% / .95);
  --radius: 1rem;

  --font-display: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-serif: 'Source Serif 4', Georgia, serif;

  --ease: cubic-bezier(.16, 1, .3, 1);

  /* functional status signals only — never used decoratively */
  --status-ok: #b9f0d0;
  --status-warn: #f4dcae;
  --status-err: #f3b6b6;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-display);
  background: var(--background);
  color: var(--foreground);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3 { font-weight: 500; }
h1 em, h1 i, h1 .italic,
h2 em, h2 i, h2 .italic,
h3 em, h3 i, h3 .italic {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  color: hsl(0 0% 100% / .95);
}
a { color: inherit; text-decoration: none; }
::selection { background: hsl(156 45% 48% / .35); }
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: hsl(160 22% 7%); }
::-webkit-scrollbar-thumb { background: hsl(156 18% 26%); border-radius: 100px; border: 3px solid hsl(160 22% 7%); }
::-webkit-scrollbar-thumb:hover { background: hsl(156 20% 36%); }

a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid hsl(0 0% 100% / .85); outline-offset: 3px; border-radius: 10px;
}
.skip-link {
  position: fixed; left: 16px; top: -60px; z-index: 100;
  padding: 10px 18px; border-radius: 100px; background: #fff; color: #000;
  font-size: .8rem; font-weight: 600; transition: top .25s var(--ease);
}
.skip-link:focus { top: 16px; }

/* ==============================================================
   PAGE BACKDROP — quiet black gradient + grain (no hero video
   outside index.html; the same ambient background works standalone)
   ============================================================== */
.bg-base {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(44% 38% at 16% 16%, hsl(158 34% 56% / .26), transparent 68%),
    radial-gradient(50% 44% at 88% 10%, hsl(150 30% 48% / .20), transparent 70%),
    radial-gradient(56% 48% at 80% 76%, hsl(162 36% 54% / .26), transparent 70%),
    radial-gradient(46% 42% at 8% 86%, hsl(146 28% 46% / .20), transparent 70%),
    radial-gradient(38% 34% at 52% 48%, hsl(155 26% 40% / .15), transparent 72%),
    linear-gradient(180deg, hsl(160 24% 10%), hsl(156 22% 13%) 45%, hsl(162 26% 8%));
}
.bg-grain {
  position: fixed; inset: 0; z-index: 3; pointer-events: none; opacity: .05; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.page { position: relative; z-index: 10; }

/* ==============================================================
   LIQUID GLASS — two tiers  (borders are drawn only by ::before)
   ============================================================== */
.liquid-glass, .liquid-glass-strong {
  position: relative;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.01);
  background-blend-mode: luminosity;
  border: none;
}
.liquid-glass {
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.1);
}
.liquid-glass::before, .liquid-glass-strong::before {
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit;
  padding: 1.4px;
  background: linear-gradient(180deg,
    rgba(255,255,255,0.45) 0%,
    rgba(255,255,255,0.15) 20%,
    transparent 40%,
    transparent 60%,
    rgba(255,255,255,0.15) 80%,
    rgba(255,255,255,0.45) 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events: none;
}
.liquid-glass-strong {
  backdrop-filter: blur(50px);
  -webkit-backdrop-filter: blur(50px);
  box-shadow: 4px 4px 4px rgba(0, 0, 0, 0.05), inset 0 1px 1px rgba(255, 255, 255, 0.15);
}
.liquid-glass-strong::before {
  background: linear-gradient(180deg,
    rgba(255,255,255,0.5) 0%,
    rgba(255,255,255,0.2) 20%,
    transparent 40%,
    transparent 60%,
    rgba(255,255,255,0.2) 80%,
    rgba(255,255,255,0.5) 100%);
}

/* interaction language */
.scale-hover { transition: transform .3s var(--ease); will-change: transform; }
.scale-hover:hover { transform: scale(1.05); }
.cta-press:active { transform: scale(.95); }
.icon-orb {
  width: 32px; height: 32px; border-radius: 50%; flex: none;
  background: hsl(0 0% 100% / .1);
  display: flex; align-items: center; justify-content: center;
}
.icon-orb svg { width: 15px; height: 15px; }

/* ==============================================================
   BRAND / NAV primitives (shared between the landing header and
   the app-shell header)
   ============================================================== */
.brand { display: inline-flex; align-items: center; gap: 11px; }
.brand-mark { width: 32px; height: 32px; flex: none; color: #fff; filter: drop-shadow(0 2px 8px rgba(0,0,0,.35)); }
.brand-name { font-size: 1.5rem; font-weight: 600; letter-spacing: -.045em; color: #fff; }
.brand-name span { color: hsl(0 0% 100% / .82); font-weight: 400; }
/* ".brand-name .beta-tag" (not just ".beta-tag") so it outranks the
   ".brand-name span" rule above. */
.brand-name .beta-tag, .foot-brand .beta-tag { font-size: .58rem; font-weight: 600; letter-spacing: .18em;
  text-transform: uppercase; color: hsl(0 0% 100% / .92); border: 1px solid hsl(0 0% 100% / .35);
  padding: 2px 7px; border-radius: 100px; margin-left: 8px; vertical-align: middle; }

.pill {
  display: inline-flex; align-items: center;
  padding: 8px 17px; border-radius: 100px;
  font-size: .75rem; font-weight: 400; color: hsl(0 0% 100% / .95);
  white-space: nowrap;
}

.account-btn {
  display: inline-flex; align-items: center; gap: 9px; cursor: pointer;
  padding: 10px 20px; border-radius: 100px;
  font-size: .82rem; font-weight: 500; color: #fff;
}

/* ==============================================================
   TABS (signup/login toggle, generator's 3-step tabs, app-shell nav)
   ============================================================== */
.tabs { display: flex; gap: 6px; padding: 6px; border-radius: 100px; }
.tab-btn {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px;
  background: none; border: none; cursor: pointer;
  color: hsl(0 0% 100% / .82); padding: 11px 10px; border-radius: 100px;
  font-family: inherit; font-size: .82rem; font-weight: 500;
  transition: color .2s, background .25s, transform .3s var(--ease);
}
.tab-btn:hover { color: #fff; }
.tab-btn .tn {
  width: 20px; height: 20px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center;
  font-size: .66rem; background: hsl(0 0% 100% / .1); color: hsl(0 0% 100% / .88);
  transition: background .2s, color .2s;
}
.tab-btn.active { color: #000; background: #fff; }
.tab-btn.active .tn { background: rgba(0,0,0,.14); color: #000; }
@media (max-width: 620px) { .tab-btn span.txt { display: none; } }

.tab-content { display: none; }
.tab-content.active { display: block; animation: fadeUp .35s var(--ease); }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ==============================================================
   FORM PRIMITIVES
   ============================================================== */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
@media (max-width: 640px) { .grid-2 { grid-template-columns: 1fr; } }

.form-group { margin-bottom: 17px; }
label { display: block; margin-bottom: 7px; font-weight: 500; font-size: .8rem; color: hsl(0 0% 100% / .9); }
label small { color: hsl(0 0% 100% / .68); font-weight: 300; margin-left: 4px; }

input[type=text], input[type=email], input[type=password], select, textarea {
  width: 100%; padding: 12px 15px;
  background: hsl(0 0% 0% / .3);
  border: 1px solid hsl(0 0% 100% / .12);
  border-radius: 14px; color: #fff;
  font-family: inherit; font-size: .87rem; outline: none;
  transition: border-color .2s, background .2s;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
input::placeholder, textarea::placeholder { color: hsl(0 0% 100% / .5); }
input[type=text]:focus, input[type=email]:focus, input[type=password]:focus,
select:focus, textarea:focus { border-color: hsl(0 0% 100% / .68); background: hsl(0 0% 0% / .45); }
select { cursor: pointer; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' stroke='%23ffffff99' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 38px; }
select option { background: #101a15; color: #fff; }
textarea { resize: vertical; min-height: 90px; }

.password-field { position: relative; }
.password-field input { padding-right: 46px; }
.password-toggle {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 10px; background: transparent; color: hsl(0 0% 100% / .68);
  cursor: pointer; transition: color .2s, background .2s;
}
.password-toggle:hover, .password-toggle:focus-visible {
  color: #fff; background: hsl(0 0% 100% / .08); outline: none;
}
.password-toggle svg { width: 18px; height: 18px; }
.password-toggle .eye-off { display: none; }
.password-toggle[aria-pressed="true"] .eye { display: none; }
.password-toggle[aria-pressed="true"] .eye-off { display: block; }

.link-btn {
  background: none; border: none; cursor: pointer; padding: 2px 0;
  color: hsl(0 0% 100% / .88); font-family: inherit; font-size: .74rem; font-weight: 500;
  text-decoration: underline; text-underline-offset: 3px; text-decoration-color: hsl(0 0% 100% / .3);
}
.link-btn:hover { color: #fff; }

/* per-field "AI Fill" / "Format" buttons (Notes tab) */
.field-actions { display: flex; align-items: center; gap: 8px; margin: -3px 0 8px; flex-wrap: wrap; }
.field-ai-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 100px; cursor: pointer;
  background: hsl(0 0% 100% / .07); color: hsl(0 0% 100% / .88); border: 1px solid hsl(0 0% 100% / .14);
  font-family: inherit; font-size: .72rem; font-weight: 500;
  transition: transform .2s var(--ease), background .2s;
}
.field-ai-btn:hover:not(:disabled) { transform: scale(1.03); background: hsl(0 0% 100% / .14); color: #fff; }
.field-ai-btn:disabled { opacity: .55; cursor: not-allowed; }
.field-ai-btn svg { width: 12px; height: 12px; flex: none; }
.field-ai-msg { font-size: .72rem; color: hsl(0 0% 100% / .68); }
.field-ai-msg.ok { color: var(--status-ok); }
.field-ai-msg.err { color: var(--status-err); }

button[type=submit], .btn-primary {
  width: 100%; margin-top: 14px; padding: 16px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  background: #fff; color: #000; border: none; border-radius: 100px;
  font-family: inherit; font-size: .96rem; font-weight: 600;
  transition: transform .3s var(--ease), opacity .2s;
}
button[type=submit]:hover:not(:disabled), .btn-primary:hover:not(:disabled) { transform: scale(1.02); }
button[type=submit]:active:not(:disabled), .btn-primary:active:not(:disabled) { transform: scale(.97); }
button[type=submit]:disabled, .btn-primary:disabled { opacity: .55; cursor: not-allowed; }
.spin {
  width: 16px; height: 16px; border-radius: 50%; display: none;
  border: 2px solid rgba(0,0,0,.25); border-top-color: #000;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.btn-ghost {
  padding: 10px 18px; border-radius: 100px; cursor: pointer;
  background: hsl(0 0% 100% / .07); color: #fff; border: none;
  font-family: inherit; font-size: .82rem; font-weight: 500;
  transition: transform .3s var(--ease), background .2s;
}
.btn-ghost:hover { transform: scale(1.03); background: hsl(0 0% 100% / .14); }
.btn-danger {
  padding: 8px 14px; border-radius: 100px; cursor: pointer;
  background: hsl(0 30% 60% / .12); color: var(--status-err); border: none;
  font-family: inherit; font-size: .76rem; font-weight: 500;
  transition: background .2s;
}
.btn-danger:hover { background: hsl(0 30% 60% / .2); }

/* status text + meters (job status, quota meter) */
.status-line { margin-top: 22px; text-align: center; font-weight: 500; font-size: .9rem; min-height: 22px; color: hsl(0 0% 100% / .97); }
.status-line.err { color: var(--status-err); }
.status-line.ok { color: var(--status-ok); }
.status-line.warn { color: var(--status-warn); }

.meter { height: .5rem; background: hsl(0 0% 100% / .1); border-radius: 1rem; overflow: hidden; margin: .5rem 0; }
.meter > span { display: block; height: 100%; background: #fff; transition: width .4s var(--ease); }

.badge {
  display: inline-block; font-size: .72rem; font-weight: 600; padding: .18rem .6rem; border-radius: 1rem;
  background: hsl(0 0% 100% / .1); color: hsl(0 0% 100% / .92);
}
.badge.ok { color: var(--status-ok); background: hsl(150 40% 50% / .14); }
.badge.warn { color: var(--status-warn); background: hsl(38 60% 60% / .14); }

/* generic card surface (used by profile/keys/jobs panels) */
.panel-card {
  border-radius: 20px; padding: 22px 24px; margin-bottom: 18px;
}
.panel-card h2 {
  font-size: .68rem; font-weight: 600; letter-spacing: .18em; text-transform: uppercase;
  color: hsl(0 0% 100% / .68); margin-bottom: 14px;
}

table.data-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
table.data-table th, table.data-table td { text-align: left; padding: .6rem .4rem; border-bottom: 1px solid hsl(0 0% 100% / .08); }
table.data-table th { color: hsl(0 0% 100% / .6); font-weight: 600; font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; }

.muted { color: hsl(0 0% 100% / .68); font-size: .85rem; }
.keybox {
  background: hsl(0 0% 0% / .4); color: hsl(0 0% 100% / .92); padding: .6rem .75rem; border-radius: .6rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .82rem; word-break: break-all; margin: .5rem 0;
}
.hidden { display: none !important; }
