/* Vibrix for Business — customer portal.
 *
 * Extends vibes-theme.css rather than replacing it: every colour here is one of
 * the existing tokens, so the portal is recognisably the same product as the
 * public /business page it is reached from. Nothing in this file changes any
 * existing page.
 */

/* The `hidden` attribute must win over the layout rules below. Class selectors
 * like `.bp-field { display: flex }` outrank the user-agent `[hidden]` rule, so
 * conditionally-hidden fields would otherwise stay on screen. */
[hidden] { display: none !important; }

/* ─── Shell ───────────────────────────────────── */

.bp-shell {
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0 72px;
}

/* Panels are OPAQUE, matching .hero and .card in vibes-theme.css. The page
 * background is deliberately light (--page), so a translucent dark surface
 * washes out to grey instead of reading as a panel. */
.bp-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 26px;
  padding: 14px 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  background: var(--s1);
  box-shadow: var(--panel-shadow);
}

.bp-nav-links { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }

.bp-nav-links a {
  padding: 8px 13px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.bp-nav-links a:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }
.bp-nav-links a.is-active { color: var(--text); background: rgba(123, 69, 255, 0.24); }

.bp-nav .brand-name { font-size: 15px; }
.bp-nav-suffix { color: var(--muted-2); font-size: 14px; font-weight: 500; }

/* ─── Panels ──────────────────────────────────── */

.bp-panel {
  border: 1px solid var(--border-sub);
  border-radius: 18px;
  background: var(--s1);
  box-shadow: var(--panel-shadow);
  padding: 22px;
  margin-bottom: 18px;
}

/* The page heading sits directly on the light page background, so it takes dark
 * ink — the same treatment .section-header uses on the public site. Inheriting
 * the theme's white --text here would make it invisible. */
.bp-page-head { color: var(--bg); }
.bp-page-head h1 { color: var(--bg); margin: 0; font-size: 23px; letter-spacing: -0.02em; }
.bp-page-head .bp-hint { color: rgba(7, 7, 17, 0.62); }

.bp-panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.bp-panel h2 { margin: 0; font-size: 17px; letter-spacing: -0.01em; }
.bp-panel h3 { margin: 0 0 10px; font-size: 14px; }

.bp-sec-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin: 0 0 12px;
}

.bp-grid { display: grid; gap: 18px; }
.bp-grid-2 { grid-template-columns: 1fr 1fr; }
.bp-grid-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 760px) {
  .bp-grid-2, .bp-grid-3 { grid-template-columns: 1fr; }
}

/* ─── Key/value ───────────────────────────────── */

.bp-kv { display: grid; gap: 9px; margin: 0; }
.bp-kv > div {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 12px;
  align-items: baseline;
}
.bp-kv dt { color: var(--muted-2); font-size: 13px; margin: 0; }
.bp-kv dd { margin: 0; font-size: 14px; }
@media (max-width: 560px) {
  .bp-kv > div { grid-template-columns: 1fr; gap: 2px; }
}

/* Amounts line up only when the digits do. */
.bp-num { font-variant-numeric: tabular-nums; }
.bp-mono {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
  font-size: 13px;
  letter-spacing: 0.02em;
}

/* ─── Progress pipeline ───────────────────────── */

.bp-pipeline {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.bp-step {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
}

.bp-step .bp-dot {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  font-size: 10px;
  font-weight: 700;
}

/* No step state is red. Red means a negative outcome elsewhere in the product,
 * and reusing it for "you are here" makes a healthy campaign look broken. */
.bp-step.is-complete {
  background: rgba(88, 214, 141, 0.14);
  border-color: rgba(88, 214, 141, 0.34);
  color: #8fe3b0;
}
.bp-step.is-complete .bp-dot { background: #58d68d; color: #06210f; }

.bp-step.is-current {
  background: rgba(123, 69, 255, 0.2);
  border-color: var(--border);
  color: var(--violet-soft);
}
.bp-step.is-current .bp-dot { background: var(--purple); color: #fff; }

.bp-step.is-upcoming {
  background: rgba(255, 255, 255, 0.035);
  border-color: var(--border-sub);
  color: var(--muted-2);
}
.bp-step.is-upcoming .bp-dot { background: rgba(255, 255, 255, 0.1); color: var(--muted-2); }

/* ─── Status callout ──────────────────────────── */

.bp-callout {
  border: 1px solid var(--border-sub);
  border-left-width: 3px;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 18px;
  /* Opaque for the same reason as .bp-panel: callouts render above the first
   * panel, directly on the light page. */
  background: var(--s1);
  box-shadow: var(--panel-shadow);
}
.bp-callout h3 { margin: 0 0 4px; font-size: 15px; }
.bp-callout p { margin: 0; font-size: 13.5px; color: var(--muted); line-height: 1.5; }

.bp-tone-good { border-left-color: #58d68d; background-image: linear-gradient(rgba(88, 214, 141, 0.09), rgba(88, 214, 141, 0.09)); }
.bp-tone-info { border-left-color: var(--purple); background-image: linear-gradient(rgba(123, 69, 255, 0.11), rgba(123, 69, 255, 0.11)); }
.bp-tone-warn { border-left-color: var(--coral); background-image: linear-gradient(rgba(255, 133, 66, 0.11), rgba(255, 133, 66, 0.11)); }
.bp-tone-bad { border-left-color: var(--magenta); background-image: linear-gradient(rgba(242, 63, 157, 0.11), rgba(242, 63, 157, 0.11)); }
.bp-tone-muted { border-left-color: var(--muted-2); background-image: linear-gradient(rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.04)); }

/* ─── Badges ──────────────────────────────────── */

.bp-badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
}
.bp-badge.good { background: rgba(88, 214, 141, 0.14); color: #8fe3b0; border-color: rgba(88, 214, 141, 0.3); }
.bp-badge.info { background: rgba(123, 69, 255, 0.18); color: var(--violet-soft); border-color: var(--border); }
.bp-badge.warn { background: rgba(255, 133, 66, 0.14); color: #ffb083; border-color: rgba(255, 133, 66, 0.3); }
.bp-badge.bad  { background: rgba(242, 63, 157, 0.14); color: #ff90c4; border-color: var(--border-pink); }
.bp-badge.muted { background: rgba(255, 255, 255, 0.06); color: var(--muted); border-color: var(--border-sub); }

/* ─── Tables ──────────────────────────────────── */

.bp-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.bp-table th {
  text-align: left;
  padding: 9px 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-2);
  border-bottom: 1px solid var(--border-sub);
}
.bp-table td { padding: 13px 12px; border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
.bp-table tbody tr:last-child td { border-bottom: none; }
.bp-table tbody tr:hover { background: rgba(255, 255, 255, 0.025); }
.bp-table a { color: var(--violet-soft); text-decoration: none; font-weight: 600; }
.bp-table a:hover { text-decoration: underline; }
.bp-table .bp-right { text-align: right; }

.bp-table-wrap { overflow-x: auto; }

/* ─── Forms ───────────────────────────────────── */

.bp-form { display: grid; gap: 16px; }
.bp-row { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; }
@media (max-width: 620px) { .bp-row { grid-template-columns: 1fr; } }

.bp-field { display: flex; flex-direction: column; gap: 6px; }
.bp-field label { font-size: 13px; color: var(--muted); font-weight: 600; }
.bp-field input,
.bp-field select,
.bp-field textarea {
  width: 100%;
  padding: 11px 13px;
  border-radius: 12px;
  font: inherit;
  color: var(--text);
  background: var(--bg-2);
  border: 1px solid var(--border-sub);
  outline: none;
}
.bp-field input:focus,
.bp-field select:focus,
.bp-field textarea:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px var(--glow);
}
.bp-field textarea { min-height: 108px; resize: vertical; }
.bp-field select option { color: #111; }
.bp-hint { font-size: 12px; color: var(--muted-2); line-height: 1.45; }

.bp-check { display: flex; align-items: flex-start; gap: 10px; font-size: 13.5px; color: var(--muted); }
.bp-check input { margin-top: 3px; accent-color: var(--purple); }

/* Choice cards — the placement picker. */
.bp-choices { display: grid; gap: 12px; grid-template-columns: repeat(3, 1fr); }
@media (max-width: 720px) { .bp-choices { grid-template-columns: 1fr; } }

.bp-choice {
  display: block;
  cursor: pointer;
  padding: 16px;
  border-radius: 14px;
  border: 1px solid var(--border-sub);
  background: var(--bg-2);
  transition: border-color 0.15s, background 0.15s;
}
.bp-choice:hover { border-color: var(--border); }
.bp-choice input { position: absolute; opacity: 0; pointer-events: none; }
.bp-choice.is-selected {
  border-color: var(--purple);
  background: rgba(123, 69, 255, 0.13);
  box-shadow: 0 0 0 3px var(--glow);
}
.bp-choice strong { display: block; font-size: 15px; margin-bottom: 5px; }
.bp-choice span { font-size: 12.5px; color: var(--muted-2); line-height: 1.45; }

/* ─── Buttons ─────────────────────────────────── */

.bp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: 12px;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  transition: filter 0.15s, background 0.15s;
}
.bp-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.bp-btn.primary { background: var(--grad); color: #fff; }
.bp-btn.primary:not(:disabled):hover { filter: brightness(1.09); }
.bp-btn.secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border-color: var(--border-sub);
}
.bp-btn.secondary:not(:disabled):hover { background: rgba(255, 255, 255, 0.11); }
.bp-btn.ghost { background: transparent; color: var(--muted); }
.bp-btn.ghost:hover { color: var(--text); }

.bp-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ─── Auth pages ──────────────────────────────── */

.bp-auth {
  width: min(440px, calc(100% - 32px));
  margin: 8vh auto 0;
}
.bp-auth-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 22px;
  text-decoration: none;
  color: var(--text);
}
.bp-auth-brand img { width: 34px; height: 34px; border-radius: 9px; }
.bp-auth h1 { font-size: 22px; margin: 0 0 6px; text-align: center; }
.bp-auth .bp-lede { text-align: center; color: var(--muted); font-size: 14px; margin: 0 0 22px; }
.bp-auth-foot { text-align: center; margin-top: 18px; font-size: 13.5px; color: var(--muted); }
.bp-auth-foot a { color: var(--violet-soft); font-weight: 600; text-decoration: none; }

/* ─── Status / empty ──────────────────────────── */

.bp-status { font-size: 14px; min-height: 20px; line-height: 1.5; }
.bp-status.err { color: #ff90c4; }
.bp-status.ok { color: #8fe3b0; }

.bp-empty {
  text-align: center;
  padding: 42px 20px;
  color: var(--muted-2);
  font-size: 14px;
}
.bp-empty strong { display: block; color: var(--muted); font-size: 15px; margin-bottom: 6px; }

.bp-loading { color: var(--muted-2); font-size: 14px; padding: 20px 0; }

/* ─── Stats ───────────────────────────────────── */

.bp-stats { display: grid; gap: 12px; grid-template-columns: repeat(4, 1fr); }
@media (max-width: 760px) { .bp-stats { grid-template-columns: 1fr 1fr; } }

.bp-stat {
  border: 1px solid var(--border-sub);
  border-radius: 14px;
  padding: 15px;
  /* Opaque so a stat grid reads correctly whether it sits inside a panel or
   * directly on the light page. */
  background: var(--s1);
  box-shadow: var(--panel-shadow);
}
.bp-panel .bp-stat { background: var(--s2); box-shadow: none; }
.bp-stat .bp-stat-label {
  display: block;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin-bottom: 6px;
}
.bp-stat .bp-stat-value { font-size: 21px; font-weight: 700; font-variant-numeric: tabular-nums; }
.bp-stat .bp-stat-note { display: block; font-size: 11.5px; color: var(--muted-2); margin-top: 4px; }

/* ─── Bank details ────────────────────────────── */

.bp-bank {
  border: 1px dashed var(--border);
  border-radius: 14px;
  padding: 16px;
  background: rgba(123, 69, 255, 0.06);
}
.bp-bank .bp-kv dd { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13.5px; }
.bp-copy {
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
  border-radius: 7px;
  padding: 2px 7px;
  font-size: 11px;
  cursor: pointer;
  margin-left: 8px;
}
.bp-copy:hover { color: var(--text); background: rgba(255, 255, 255, 0.14); }

/* ─── Creative uploads ────────────────────────── */
/* Mirrors the admin campaign wizard's per-placement image fields, built from
 * the same tokens as the rest of the portal. */

.bp-upload {
  border: 1px solid var(--border-sub);
  border-radius: 14px;
  padding: 16px;
  background: var(--s2);
}

.bp-upload-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 4px;
}

.bp-file {
  display: block;
  width: 100%;
  margin-top: 10px;
  font: inherit;
  font-size: 13px;
  color: var(--muted);
}
/* The native button is unstyleable across browsers; this at least makes it
 * legible on the dark surface instead of a white slab. */
.bp-file::file-selector-button {
  font: inherit;
  font-weight: 600;
  font-size: 13px;
  margin-right: 12px;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid var(--border-sub);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  cursor: pointer;
}
.bp-file::file-selector-button:hover { background: rgba(255, 255, 255, 0.11); }

.bp-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding: 10px;
  border-radius: 12px;
  background: var(--bg-2);
  border: 1px solid var(--border-sub);
}
.bp-preview img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 9px;
  flex: none;
}
.bp-preview-name {
  font-size: 12.5px;
  color: var(--muted);
  word-break: break-all;
}
