/* billing-account.css — customer-facing billing UX (onboarding overlay, billing page, soft-block).
   Distinct from billing.css (internal metering panel). Uses the shared design tokens + .ou-* where
   possible (CLAUDE.md rule #2); .bac-* covers only the billing-specific surfaces. */

/* ── Onboarding overlay (gated before app use) ────────────────────────────────────────── */
.bac-overlay {
  position: fixed; inset: 0; z-index: 100001;
  background: rgba(0,0,0,.62); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.bac-ob-card {
  width: 480px; max-width: 100%; max-height: calc(100vh - 40px); overflow-y: auto;
  background: var(--surface, #1b1b1f); color: var(--text, #eee);
  border: 1px solid var(--border, #333); border-radius: 16px;
  box-shadow: 0 18px 60px rgba(0,0,0,.45); padding: 22px 24px;
}
.bac-ob-head { margin-bottom: 14px; }
.bac-ob-title { font-size: 19px; font-weight: 700; }
.bac-ob-sub { font-size: 12.5px; color: var(--text-dim, #999); margin-top: 4px; line-height: 1.4; }
.bac-ob-steps { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 6px 0 16px; }
.bac-ob-dot {
  width: 20px; height: 20px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; background: rgba(127,127,127,.18); color: var(--text-dim, #999); flex: 0 0 auto;
}
.bac-ob-dot.active { background: var(--accent, #6aa3ff); color: #fff; }
.bac-ob-dot.done { background: var(--success, #3ba55d); color: #fff; }
.bac-ob-steplbl { font-size: 12px; color: var(--text-dim, #999); margin-right: 8px; }
.bac-ob-body { display: flex; flex-direction: column; gap: 6px; }
.bac-ob-p { font-size: 13.5px; line-height: 1.5; color: var(--text, #eee); margin: 0 0 8px; }
.bac-ob-note { font-size: 12px; color: var(--text-dim, #999); line-height: 1.4; margin-top: 2px; }
.bac-ob-err { font-size: 12.5px; color: var(--danger, #e5534b); min-height: 16px; margin: 4px 0; }
.bac-ob-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }

.bac-field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 10px; }
.bac-field label { font-size: 12px; font-weight: 600; color: var(--text-dim, #bbb); }
.bac-field input {
  background: var(--bg, #111); color: var(--text, #eee); border: 1px solid var(--border, #333);
  border-radius: 8px; padding: 9px 11px; font-size: 14px; font-family: inherit; width: 100%; box-sizing: border-box;
}
.bac-field input:focus { outline: none; border-color: var(--accent, #6aa3ff); }

.bac-ob-plan { background: rgba(127,127,127,.07); border: 1px solid var(--border, #333); border-radius: 10px; padding: 12px 14px; margin-bottom: 12px; }
.bac-plan-row { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; font-size: 13px; }
.bac-plan-k { color: var(--text-dim, #999); }
.bac-plan-v { color: var(--text, #eee); font-weight: 600; text-align: right; }

.bac-tc { display: flex; align-items: flex-start; gap: 9px; font-size: 12.5px; line-height: 1.45; color: var(--text, #ddd); cursor: pointer; margin: 8px 0; }
.bac-tc input { margin-top: 2px; flex: 0 0 auto; }
.bac-at-box { border-top: 1px solid var(--border, #333); margin-top: 12px; padding-top: 12px; }
.bac-at-fields { display: flex; gap: 12px; margin-top: 8px; }
.bac-at-fields .bac-field { flex: 1; margin-bottom: 0; }

/* Stripe Payment Element mount — the Element renders its own themed fields (appearance API),
   so the wrapper stays minimal; a heavy border/background here would double up on Stripe's. */
.bac-card-el { margin: 10px 0 4px; min-height: 44px; }

/* ── Billing page (Settings → Billing & Subscription) ─────────────────────────────────────
   Hosted as a settings section (NOT a launcher panel). A centred max-width container gives the
   page proper side margins instead of edge-to-edge cramming, consistent with the Settings UI. */
.bac-settings-host { width: 100%; }
.bac-settings-host .bac-page {
  max-width: 760px; margin: 0 auto; width: 100%; box-sizing: border-box;
  padding: 4px 18px 36px; display: flex; flex-direction: column; gap: 16px;
}
.bac-pane { display: flex; flex-direction: column; gap: 14px; padding-top: 14px; }
.bac-statline { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.bac-modepill { font-size: 12px; color: var(--text-dim, #999); border: 1px solid var(--border, #333); border-radius: 999px; padding: 3px 10px; }
.bac-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.bac-note { font-size: 12px; color: var(--text-dim, #999); line-height: 1.4; }
.bac-subtabs { margin-bottom: 2px; }

/* Section titles (Payment & Invoices tab) */
.bac-section-title {
  font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  color: var(--text-dim, #999); margin: 20px 0 8px;
}
.bac-section-title:first-child { margin-top: 6px; }

/* Saved-card display block */
.bac-card-box {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface, #1b1b1f); border: 1px solid var(--border, #333); border-radius: 12px;
  padding: 14px 16px;
}
.bac-card-icon { flex: 0 0 auto; color: var(--accent, #6aa3ff); display: flex; align-items: center; }
.bac-card-icon svg { width: 28px; height: 28px; }
.bac-card-info { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.bac-card-main { font-size: 14px; font-weight: 600; color: var(--text, #eee); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bac-card-sub { font-size: 12px; color: var(--text-dim, #999); line-height: 1.4; }
.bac-card-action { flex: 0 0 auto; }

/* Legacy tab bar (kept for any non-OscarUI fallback; the page now uses OscarUI tabs) */
.bac-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border, #333); overflow-x: auto; }
.bac-tab { background: transparent; border: none; border-bottom: 2px solid transparent; color: var(--text-dim, #999);
  font-size: 13px; font-weight: 600; padding: 9px 14px; cursor: pointer; white-space: nowrap; font-family: inherit; }
.bac-tab.active { color: var(--text, #eee); border-bottom-color: var(--accent, #6aa3ff); }

/* Invoices list */
.bac-inv-row { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 8px; border-bottom: 1px solid var(--border, #2a2a2a); font-size: 13px; }
.bac-inv-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.bac-inv-num { font-weight: 600; color: var(--text, #eee); }
.bac-inv-sub { font-size: 11.5px; color: var(--text-dim, #999); }
.bac-inv-right { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }

/* ── Soft-block / dunning banner (floating, does NOT reflow the fixed app layout) ───────── */
.bac-banner {
  position: fixed; top: 8px; left: 50%; transform: translateX(-50%); z-index: 100000;
  max-width: min(720px, calc(100vw - 24px));
  display: flex; align-items: center; gap: 14px;
  background: var(--warning, #d98a2b); color: #1a1205;
  border-radius: 10px; padding: 9px 14px; box-shadow: 0 10px 30px rgba(0,0,0,.35);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; font-size: 13px; font-weight: 600;
}
.bac-banner.blocked { background: var(--danger, #e5534b); color: #fff; }
.bac-banner-txt { line-height: 1.35; }
.bac-banner-btn {
  flex: 0 0 auto; background: rgba(0,0,0,.18); color: inherit; border: 1px solid rgba(0,0,0,.25);
  border-radius: 7px; padding: 6px 12px; font-size: 12.5px; font-weight: 700; cursor: pointer; font-family: inherit; white-space: nowrap;
}
.bac-banner-btn:hover { background: rgba(0,0,0,.28); }
.bac-banner.blocked .bac-banner-btn { background: rgba(255,255,255,.18); border-color: rgba(255,255,255,.3); }

/* Read-only visual cue while blocked (composer is also disabled in JS). */
body.bac-blocked #textInput { opacity: .6; }
