/* Beyond Bankruptcy — plugin UI components.
   Inherits the custom properties declared in style.css. */

/* ---------------------------------------------------------------- buttons */
.bb-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font: inherit; font-weight: 600; font-size: 1.02rem;
  padding: 15px 28px; border-radius: 999px; border: 1.5px solid transparent;
  text-decoration: none; cursor: pointer; min-height: 52px;
  transition: background .15s, color .15s, border-color .15s;
}
.bb-btn-primary { background: var(--clay); color: #fff; }
.bb-btn-primary:hover { background: var(--clay-dark); color: #fff; }
.bb-btn-teal { background: var(--teal-800); color: #fff; }
.bb-btn-teal:hover { background: var(--teal-700); color: #fff; }
.bb-btn-ghost { border-color: var(--line); color: var(--teal-800); background: transparent; }
.bb-btn-ghost:hover { border-color: var(--teal-700); background: var(--sand-2); }

/* ----------------------------------------------------------------- intake */
.bb-intake { max-width: 760px; margin: 0 auto; padding: 48px 0 72px; }
.bb-intake h1 { margin-bottom: .3em; }
.bb-intake-sub { color: var(--muted); font-size: 1.08rem; margin-bottom: 30px; }
.bb-intake-progress {
  font-size: .82rem; font-weight: 700; letter-spacing: .11em; text-transform: uppercase;
  color: var(--teal-600); margin-bottom: 14px;
}
.bb-intake-back { margin-top: 34px; }
.bb-intake-back a { color: var(--muted); text-decoration: none; }
.bb-intake-back a:hover { color: var(--teal-700); }

.bb-door-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(258px, 1fr)); }
.bb-door {
  display: flex; align-items: center; background: #fff;
  border: 1.5px solid var(--line); border-radius: var(--radius-lg);
  padding: 24px 26px; text-decoration: none; color: var(--ink);
  font-size: 1.08rem; font-weight: 500; line-height: 1.35;
  box-shadow: var(--shadow); min-height: 96px;
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.bb-door:hover { border-color: var(--teal-500); transform: translateY(-2px); box-shadow: var(--shadow-lg); color: var(--ink); }
.bb-door-quiet { background: transparent; box-shadow: none; border-style: dashed; }

.bb-intake-form select,
.bb-intake-form input[type=text] {
  width: 100%; max-width: 420px; font: inherit; font-size: 1.05rem;
  padding: 14px 16px; border: 1.5px solid var(--line); border-radius: 10px;
  background: #fff; color: var(--ink); min-height: 54px; margin-bottom: 24px;
}

.bb-checkgrid { display: grid; gap: 6px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); margin-bottom: 26px; }
.bb-check { display: flex; align-items: flex-start; gap: 11px; padding: 9px 0; cursor: pointer; font-size: 1rem; }
.bb-check input { margin-top: 5px; width: 19px; height: 19px; accent-color: var(--teal-700); flex-shrink: 0; }

.bb-money-check { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 22px; margin-bottom: 28px; }
.bb-money-check legend { font-weight: 600; color: var(--ink); padding: 0 8px; }

.bb-skip { margin-left: 18px; color: var(--muted); text-decoration: underline; }

/* ---------------------------------------------------------------- results */
.bb-results h1 { margin-bottom: .3em; }
.bb-result-list { margin: 28px 0 40px; }
.bb-result-reading { margin-top: 44px; }
.bb-disclaimer-inline {
  font-size: .92rem; color: var(--muted); background: var(--sand-2);
  border: 1px dashed var(--line); border-radius: var(--radius);
  padding: 18px 22px; margin-top: 32px;
}

/* -------------------------------------------------------------- providers */
.bb-provider {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; margin-bottom: 16px;
  display: grid; gap: 20px; grid-template-columns: 84px 1fr; align-items: start;
}
.bb-provider-featured {
  border: 2px solid var(--teal-600); box-shadow: var(--shadow-lg);
  grid-template-columns: 108px 1fr;
}
@media (max-width: 620px) { .bb-provider, .bb-provider-featured { grid-template-columns: 1fr; } }

.bb-provider-avatar {
  width: 84px; height: 84px; border-radius: 50%; background: var(--sand-3);
  display: grid; place-items: center; overflow: hidden;
  font-family: var(--serif); font-size: 1.5rem; color: var(--teal-800); font-weight: 600;
}
.bb-provider-featured .bb-provider-avatar { width: 108px; height: 108px; font-size: 1.9rem; }
.bb-provider-avatar img { width: 100%; height: 100%; object-fit: cover; }

.bb-provider h3 { margin-bottom: .12em; font-size: 1.22rem; }
.bb-provider h3 a { text-decoration: none; color: var(--ink); }
.bb-provider h3 a:hover { color: var(--teal-700); }
.bb-provider-firm { color: var(--muted); font-size: .96rem; margin: 0 0 10px; }
.bb-provider-bio { font-size: .97rem; margin-bottom: 14px; }
.bb-provider-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.bb-provider-actions .bb-btn { padding: 11px 20px; font-size: .95rem; min-height: 44px; }

.bb-badges { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 16px; }
.bb-badge {
  font-size: .82rem; padding: 5px 12px; border-radius: 999px;
  background: var(--sand-2); color: var(--body); border: 1px solid var(--line);
}
.bb-badge-good { background: var(--teal-100); border-color: #bcd8d1; color: var(--teal-800); }

.bb-ad-label {
  font-size: .72rem; letter-spacing: .09em; text-transform: uppercase; font-weight: 700;
  color: var(--muted); display: flex; align-items: center; gap: 7px; margin: 26px 0 12px;
}
.bb-ad-label::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--amber); }

.bb-empty { color: var(--muted); font-style: italic; }

.bb-disclaimer {
  background: var(--sand-2); border: 1px dashed var(--line); border-radius: var(--radius);
  padding: 18px 22px; font-size: .92rem; color: var(--muted); margin: 26px 0 0;
}
.bb-disclaimer p { margin: 0; max-width: none; }

/* ----------------------------------------------------------------- crisis */
.bb-crisis-panel {
  background: var(--clay-100); border: 2px solid var(--clay);
  border-radius: var(--radius-lg); padding: 30px 32px; margin: 0 0 34px; color: #6d3419;
}
.bb-crisis-panel h2 { color: #5a2b14; margin-bottom: .4em; }
.bb-crisis-number { font-size: 1.25rem; margin: 18px 0; }
.bb-crisis-number a { color: var(--clay-dark); }
.bb-crisis-small { font-size: .92rem; margin: 0; }

/* ------------------------------------------------------------------ cards */
.bb-card-grid { display: grid; gap: 22px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.bb-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.bb-card h3 { font-size: 1.15rem; margin-bottom: .35em; }
.bb-card h3 a { text-decoration: none; color: var(--ink); }
.bb-card h3 a:hover { color: var(--teal-700); }
.bb-card p { font-size: .96rem; color: var(--muted); margin: 0; }

/* ------------------------------------------------------------- state grid */
.bb-state-grid { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.bb-state-grid a {
  padding: 11px 14px; background: #fff; border: 1px solid var(--line);
  border-radius: 10px; text-decoration: none; color: var(--body); font-size: .96rem;
}
.bb-state-grid a:hover { border-color: var(--teal-500); color: var(--teal-800); }

/* -------------------------------------------------------------- inventory */
.bb-table-scroll { overflow-x: auto; }
.bb-inventory { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.bb-inventory th, .bb-inventory td { text-align: left; padding: 15px 20px; border-bottom: 1px solid var(--line); font-size: .98rem; }
.bb-inventory th { background: var(--sand-2); font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.bb-inventory tr:last-child td { border-bottom: none; }
.bb-slots { font-weight: 600; }
.bb-slots-low { color: var(--clay-dark); }
.bb-slots-none { color: var(--muted); font-weight: 500; }

/* ----------------------------------------------------------------- portal */
.bb-portal { max-width: 820px; margin: 0 auto; padding: 48px 0 72px; }
.bb-portal-form { margin-bottom: 34px; }
.bb-field { margin-bottom: 22px; }
.bb-field label { display: block; font-weight: 600; font-size: .98rem; margin-bottom: 7px; color: var(--ink); }
.bb-field input[type=text], .bb-field input[type=email], .bb-field input[type=tel],
.bb-field input[type=url], .bb-field input[type=number], .bb-field input[type=password],
.bb-field textarea, .bb-field select {
  width: 100%; max-width: 520px; font: inherit; font-size: 1rem; padding: 13px 15px;
  border: 1.5px solid var(--line); border-radius: 10px; background: #fff;
  color: var(--ink); min-height: 50px;
}
.bb-field textarea { min-height: 150px; resize: vertical; }
.bb-hint { font-size: .89rem; color: var(--muted); margin: 6px 0 0; }

.bb-consent {
  display: flex; gap: 12px; align-items: flex-start; background: var(--sand-2);
  border-radius: 10px; padding: 16px; font-size: .95rem; margin-bottom: 24px; font-weight: 400;
}
.bb-consent input { margin-top: 4px; width: 19px; height: 19px; accent-color: var(--teal-700); flex-shrink: 0; }
.bb-consent span { font-weight: 400; }

.bb-notice { padding: 15px 20px; border-radius: var(--radius); margin-bottom: 24px; font-size: .97rem; }
.bb-notice-error { background: var(--clay-100); border: 1px solid #e8cdbc; color: #6d3419; }

/* ------------------------------------------------------------------ tiers */
.bb-availability-result { margin-top: 40px; }
.bb-tier-grid { display: grid; gap: 22px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); align-items: start; }
.bb-tier { background: #fff; border: 1.5px solid var(--line); border-radius: var(--radius-lg); padding: 30px; }
.bb-tier-hero { border: 2.5px solid var(--clay); box-shadow: var(--shadow-lg); }
.bb-tier h3 { font-size: 1.3rem; margin-bottom: .3em; }
.bb-tier-slots { color: var(--teal-700); margin-bottom: 16px; }
.bb-tier-price { margin: 0 0 4px; }
.bb-amount { font-family: var(--serif); font-size: 2.8rem; color: var(--ink); line-height: 1; }
.bb-tier-alt { font-size: .94rem; color: var(--muted); margin-bottom: 22px; }
.bb-tier-full { font-size: .94rem; color: var(--muted); }

.bb-waitlist { background: var(--sand-2); border-radius: var(--radius-lg); padding: 28px; margin-top: 34px; }

/* -------------------------------------------------------------- dashboard */
.bb-stat-row { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin: 28px 0 40px; }
.bb-stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; text-align: center; }
.bb-stat-num { display: block; font-family: var(--serif); font-size: 2.6rem; color: var(--teal-800); line-height: 1; }
.bb-stat-label { display: block; font-size: .92rem; color: var(--muted); margin-top: 8px; }

.bb-status-panel { border-radius: var(--radius-lg); padding: 26px 30px; margin-bottom: 12px; border: 1.5px solid var(--line); background: #fff; }
.bb-status-live { border-color: var(--teal-600); background: var(--teal-100); }
.bb-status-pending { border-color: var(--amber); background: #fff8e9; }
.bb-status-headline { font-weight: 600; font-size: 1.1rem; color: var(--ink); margin-bottom: 16px; }
.bb-status-steps { list-style: none; padding: 0; margin: 0; }
.bb-status-steps li { padding: 9px 0 9px 34px; position: relative; }
.bb-status-steps li::before {
  position: absolute; left: 0; top: 8px; width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center; font-size: .8rem; font-weight: 700;
}
.bb-step-done::before { content: "✓"; background: var(--teal-600); color: #fff; }
.bb-step-todo::before { content: "•"; background: var(--sand-3); color: var(--muted); }
.bb-status-steps strong { display: block; color: var(--ink); }
.bb-status-steps span { font-size: .93rem; color: var(--muted); }

.bb-moderation-note { margin-top: 18px; padding: 16px 20px; background: #fff; border-left: 4px solid var(--clay); border-radius: 8px; }
.bb-moderation-note p { margin: 6px 0 0; }

/* ---------------------------------------------------------------- billing */
.bb-billing-panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; }
.bb-billing-trial { color: var(--teal-700); }
.bb-founding-rate { background: var(--clay-100); color: #6d3419; padding: 12px 16px; border-radius: 8px; font-size: .94rem; }
.bb-plan-picker { display: grid; gap: 12px; margin-top: 18px; }
.bb-plan { display: flex; gap: 14px; align-items: flex-start; border: 1.5px solid var(--line); border-radius: var(--radius); padding: 18px 20px; cursor: pointer; }
.bb-plan:has(input:checked) { border-color: var(--teal-600); background: var(--teal-100); }
.bb-plan input { margin-top: 4px; width: 19px; height: 19px; accent-color: var(--teal-700); }
.bb-plan strong { display: block; font-size: 1.08rem; color: var(--ink); }
.bb-plan em { font-style: normal; font-size: .92rem; color: var(--muted); }

.bb-portal-signout { margin-top: 44px; }
.bb-portal-signout a { color: var(--muted); }

.bb-ad-builder { border-top: 1px solid var(--line); padding-top: 34px; }

/* ------------------------------------------------------------------- chat */
.bb-chat { max-width: 760px; margin: 0 auto; }
.bb-chat-log {
  border: 1px solid var(--line); border-radius: var(--radius-lg); background: #fff;
  padding: 22px; min-height: 300px; max-height: 62vh; overflow-y: auto; margin-bottom: 16px;
}
.bb-chat-msg { margin-bottom: 20px; max-width: 88%; }
.bb-chat-msg p { margin: 0 0 .6em; }
.bb-chat-msg p:last-child { margin-bottom: 0; }
.bb-chat-assistant { color: var(--body); }
.bb-chat-user {
  margin-left: auto; background: var(--teal-100); color: var(--teal-900);
  padding: 14px 18px; border-radius: 18px 18px 4px 18px;
}

.bb-chat-form { display: flex; gap: 10px; align-items: flex-end; }
.bb-chat-form textarea {
  flex: 1; font: inherit; font-size: 1.02rem; padding: 14px 16px; resize: vertical;
  border: 1.5px solid var(--line); border-radius: 14px; background: #fff; min-height: 58px;
}
.bb-chat-form button { flex-shrink: 0; }

.bb-chat-disclaimer { font-size: .88rem; color: var(--muted); margin-top: 16px; }

.bb-chat-crisis {
  background: var(--clay-100); border: 2px solid var(--clay); border-radius: var(--radius);
  padding: 22px 24px; margin: 8px 0 20px; color: #6d3419;
}
.bb-chat-crisis strong { display: block; font-size: 1.08rem; color: #5a2b14; margin-bottom: 8px; }
.bb-chat-crisis p { margin: 0 0 14px; }

.bb-chat-providers { margin: 4px 0 20px; }
.bb-chat-provider {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; margin-bottom: 10px; background: var(--sand);
}
.bb-chat-provider-name { display: block; font-weight: 600; font-size: 1.08rem; text-decoration: none; color: var(--ink); }
.bb-chat-provider-name:hover { color: var(--teal-700); }
.bb-chat-provider-meta { display: block; color: var(--muted); font-size: .93rem; margin: 2px 0 10px; }
.bb-chat-provider-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.bb-chat-provider-actions .bb-btn { padding: 9px 16px; font-size: .92rem; min-height: 40px; }
.bb-chat-adnote { font-size: .85rem; color: var(--muted); margin: 10px 0 0; }

.bb-chat-fallback { margin: 8px 0 4px; }
