/* PBG Copilot portal. Mirrors the marketing site (pbgcopilot.com) 100 percent: the same
   teal and cream on deep teal ink, the same Poppins, the same buttons and inputs, the same
   day and night language slider, the same ambient glow. See DESIGN-SOURCE.md for the exact
   tokens and where they came from. This is a portal surface, so it follows the MARKETING
   language, never the console's white and neon. No serif. No pills as a shape. Fully
   responsive with safe area insets. Reduced motion respected. */

:root {
  /* Exact marketing tokens, copied from landing/index.html :root */
  --teal: #14768c;
  --teal-bright: #1fa3c4;
  --teal-soft: #2bbfe0;
  --cream: #c6c1b2;
  --cream-soft: #d8d4c8;
  --bg: #06151c;
  --bg-2: #0a222c;
  --stage: #031016;
  --ink: #eef3f2;
  --muted: rgba(238, 243, 242, 0.58);
  --line: rgba(198, 193, 178, 0.16);
  --danger: #ff7a7a;
  --maxw: 1080px;
  --body: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --ease-out: cubic-bezier(0.22, 0.61, 0.36, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { overflow-x: clip; }

body {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
  position: relative;
  padding:
    env(safe-area-inset-top)
    env(safe-area-inset-right)
    env(safe-area-inset-bottom)
    env(safe-area-inset-left);
}

/* Ambient glow + noise, exactly like the marketing hero background. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(900px 600px at 75% 6%, rgba(31, 163, 196, 0.16), transparent 60%),
    radial-gradient(800px 700px at 8% 92%, rgba(20, 118, 140, 0.20), transparent 60%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)'/%3E%3C/svg%3E");
}
.orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(70px);
  z-index: 0;
  pointer-events: none;
  opacity: 0.45;
}
.orb.a { width: 420px; height: 420px; background: rgba(31, 163, 196, 0.22); top: -80px; right: -60px; animation: drift1 18s ease-in-out infinite; }
.orb.b { width: 360px; height: 360px; background: rgba(20, 118, 140, 0.20); bottom: -100px; left: -80px; animation: drift2 22s ease-in-out infinite; }
@keyframes drift1 { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(-40px, 50px); } }
@keyframes drift2 { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(50px, -40px); } }

a { color: var(--teal-soft); text-decoration: none; transition: color 0.25s var(--ease-out); }
a:hover { color: var(--cream-soft); }
img { max-width: 100%; }

/* ---- top bar with the real logo and the language slider ---- */
.topbar {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 28px;
  max-width: var(--maxw);
  width: 100%;
  margin: 0 auto;
}
.brand { display: block; line-height: 0; }
.brand .mark {
  height: 36px;
  width: auto;
  display: block;
  filter: drop-shadow(0 4px 14px rgba(0, 0, 0, 0.45));
}
.lang-slot { display: inline-flex; }

/* Day and night language slider, the same control as the marketing site. */
.lang-day-night {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  width: 78px;
  height: 38px;
  border-radius: 999px;
  padding: 6px 8px;
  gap: 12px;
  flex: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.10) 0%, rgba(255, 255, 255, 0.03) 50%, rgba(0, 0, 0, 0.20) 100%), rgba(20, 20, 24, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), inset 0 -1px 0 rgba(0, 0, 0, 0.40), 0 10px 26px -12px rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(10px) saturate(125%);
  -webkit-backdrop-filter: blur(10px) saturate(125%);
  isolation: isolate;
  overflow: hidden;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
}
.lang-day-night::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.18) 50%, transparent 70%);
  transform: translateX(-50%);
  opacity: 0.5;
  transition: transform 0.9s var(--ease-out), opacity 0.35s var(--ease-out);
  pointer-events: none;
  z-index: 4;
}
.lang-day-night:hover::after { transform: translateX(50%); opacity: 0.95; }
.lang-day-night__side {
  position: relative;
  z-index: 2;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.45), 0 2px 6px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  overflow: hidden;
  background: #0a0a0c;
  transition: filter 0.35s var(--ease-out), transform 0.25s var(--ease-out);
}
.lang-day-night__side svg { width: 26px; height: 26px; display: block; }
.lang-day-night__side:hover { transform: scale(1.06); }
.lang-day-night[data-mode="day"] .lang-day-night__side--night { filter: brightness(0.6) saturate(0.7); }
.lang-day-night[data-mode="night"] .lang-day-night__side--day { filter: brightness(0.6) saturate(0.7); }
.lang-day-night__knob {
  position: absolute;
  top: 4px;
  left: 6px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.65);
  background: transparent;
  box-shadow: 0 0 0 1px rgba(217, 193, 134, 0.55), 0 0 14px rgba(217, 193, 134, 0.32), 0 4px 10px -2px rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  pointer-events: none;
  z-index: 3;
  transition: transform 0.45s var(--ease-out);
}
.lang-day-night[data-mode="night"] .lang-day-night__knob { transform: translateX(36px); }
.lang-day-night:focus-visible { outline: 2px solid var(--teal-soft); outline-offset: 3px; }

/* ---- centered card shell ---- */
.shell {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 20px 44px;
}

.card {
  width: 100%;
  max-width: 460px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 40px 38px 34px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 40px 90px -50px rgba(0, 0, 0, 0.85);
  animation: rise 0.6s var(--ease-out) both;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--cream);
  font-weight: 600;
  margin: 0 0 16px;
}
.eyebrow .dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--teal-soft);
  box-shadow: 0 0 14px var(--teal-soft);
}

h1.title {
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  font-size: clamp(1.7rem, 4.4vw, 2rem);
  margin: 0 0 12px;
  color: var(--ink);
}

p.lede {
  font-size: 15px;
  line-height: 1.65;
  color: var(--muted);
  font-weight: 300;
  margin: 0 0 26px;
}
p.lede b { color: var(--cream-soft); font-weight: 600; }

/* ---- fields ---- */
.field { margin: 0 0 16px; }
.field label {
  display: block;
  font-size: 13px;
  color: var(--cream-soft);
  font-weight: 400;
  margin: 0 0 8px;
  letter-spacing: 0.2px;
}
.field input,
.field select {
  width: 100%;
  font-family: inherit;
  font-size: 16px; /* 16px avoids iOS zoom on focus */
  color: var(--ink);
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(198, 193, 178, 0.22);
  border-radius: 13px;
  padding: 15px 17px;
  outline: none;
  transition: border-color 0.3s var(--ease-out), background 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out);
}
.field input::placeholder { color: rgba(238, 243, 242, 0.42); }
.field input:focus,
.field select:focus {
  border-color: var(--teal-bright);
  background: rgba(31, 163, 196, 0.08);
  box-shadow: 0 0 0 4px rgba(31, 163, 196, 0.12);
}
.field input:-webkit-autofill {
  -webkit-text-fill-color: var(--ink);
  -webkit-box-shadow: 0 0 0 40px #08191f inset;
  caret-color: var(--ink);
}

/* Reveal for the email first second step. */
.reveal {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.5s var(--ease-out), opacity 0.4s var(--ease-out);
}
.reveal.open { max-height: 280px; opacity: 1; }

/* ---- buttons ---- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  border: none;
  border-radius: 13px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.2px;
  padding: 16px 24px;
  cursor: pointer;
  transition: transform 0.2s var(--ease-out), box-shadow 0.25s var(--ease-out), background 0.25s var(--ease-out), opacity 0.2s;
}
.btn-primary {
  color: #04141a;
  background: linear-gradient(135deg, var(--teal-soft), var(--teal-bright));
  box-shadow: 0 10px 30px -8px rgba(31, 163, 196, 0.5);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 40px -8px rgba(31, 163, 196, 0.65); }
.btn-primary:active { transform: translateY(0); }
.btn-ghost {
  color: var(--teal-soft);
  background: rgba(31, 163, 196, 0.08);
  border: 1px solid rgba(31, 163, 196, 0.45);
}
.btn-ghost:hover { background: rgba(31, 163, 196, 0.18); transform: translateY(-1px); }
.btn:focus-visible { outline: 2px solid var(--teal-soft); outline-offset: 3px; }
.btn[disabled] { opacity: 0.55; cursor: default; transform: none; box-shadow: none; }

.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 4px 0 22px;
  font-size: 14px;
}

.foot {
  margin: 24px 0 0;
  font-size: 14px;
  color: var(--muted);
  text-align: center;
}

.note {
  min-height: 20px;
  font-size: 14px;
  line-height: 1.5;
  margin: 2px 0 16px;
}
.note.error { color: var(--danger); }
.note.ok { color: var(--teal-soft); }

/* ---- account status line ---- */
.status-line {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 14px;
  color: var(--cream-soft);
}
.status-line strong { color: var(--ink); font-weight: 600; }
.dot-status {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--teal-soft);
  box-shadow: 0 0 0 3px rgba(43, 191, 224, 0.2);
}
.dot-status.pending { background: var(--cream); box-shadow: 0 0 0 3px rgba(198, 193, 178, 0.2); }
.dot-status.suspended, .dot-status.cancelled { background: var(--danger); box-shadow: 0 0 0 3px rgba(255, 122, 122, 0.2); }

.page-footer {
  position: relative;
  z-index: 2;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  padding: 18px 0 26px;
}

/* ---- loading spinner inside a button ---- */
.spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(4, 20, 26, 0.35);
  border-top-color: #04141a;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: none;
}
.btn.loading .spinner { display: inline-block; }
.btn.loading > span:not(.spinner) { opacity: 0.85; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- pricing page ---- */
.card.wide { max-width: 1000px; }

.billing-toggle {
  display: inline-flex;
  gap: 4px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 4px;
  margin: 0 0 8px;
}
.billing-toggle button {
  appearance: none;
  background: transparent;
  border: none;
  color: var(--muted);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  border-radius: 10px;
  padding: 10px 20px;
  cursor: pointer;
  transition: color 0.25s var(--ease-out), background 0.25s var(--ease-out);
}
.billing-toggle button[aria-pressed='true'] {
  color: #04141a;
  background: linear-gradient(135deg, var(--teal-soft), var(--teal-bright));
  box-shadow: 0 8px 22px -6px rgba(31, 163, 196, 0.55);
}
.billing-toggle button:focus-visible { outline: 2px solid var(--teal-soft); outline-offset: 2px; }

.plans {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin: 0 0 26px;
}
.plan {
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 24px 20px;
  transition: transform 0.3s var(--ease-out), border-color 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out);
}
.plan:hover { transform: translateY(-4px); border-color: rgba(31, 163, 196, 0.4); box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5); }
.plan.featured { border-color: var(--teal-bright); box-shadow: 0 0 0 1px rgba(31, 163, 196, 0.28), 0 18px 50px rgba(31, 163, 196, 0.12); }
.plan h2 { font-weight: 700; font-size: 1.14rem; margin: 0 0 4px; color: var(--ink); letter-spacing: -0.01em; }
.plan .tag { font-size: 12.5px; color: var(--muted); font-weight: 300; margin: 0 0 16px; min-height: 32px; line-height: 1.5; }
.plan .price { font-size: 2.1rem; font-weight: 700; color: var(--ink); letter-spacing: -0.02em; }
.plan .price .amt::before { content: '$'; font-size: 1.1rem; vertical-align: super; margin-right: 1px; font-weight: 600; }
.plan .per { font-size: 13px; color: var(--muted); margin: 4px 0 2px; font-weight: 400; }
.plan .kind { font-size: 12.5px; color: var(--teal-soft); font-weight: 500; margin: 0 0 18px; min-height: 16px; }
.plan .btn { margin-top: auto; padding: 13px 18px; font-size: 13.5px; }

.usage {
  border-top: 1px solid var(--line);
  padding-top: 24px;
}
.usage h3 { font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--teal-soft); font-weight: 600; margin: 0 0 14px; }
.usage ul { list-style: none; margin: 0 0 12px; padding: 0; }
.usage li { display: flex; justify-content: space-between; gap: 16px; font-size: 14px; color: var(--cream-soft); font-weight: 300; padding: 9px 0; border-bottom: 1px solid var(--line); }
.usage li span:last-child { color: var(--ink); font-weight: 600; white-space: nowrap; }
.usage .incl { font-size: 13px; color: var(--muted); font-weight: 300; margin: 10px 0 0; line-height: 1.5; }
.fineprint { font-size: 12px; color: var(--muted); text-align: center; margin: 20px 0 0; }

@media (max-width: 860px) {
  .plans { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .topbar { padding: 16px 20px; }
  .brand .mark { height: 28px; }
}
@media (max-width: 480px) {
  .card { padding: 30px 24px 26px; border-radius: 16px; }
  h1.title { font-size: 1.55rem; }
  .plans { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  .card { opacity: 1 !important; transform: none !important; }
}
