/* CB Reflection Tool - Light Professional UI v1 (soft #f9f9f9) */

.cbrt-wrap {
  /* ---------- Design tokens ---------- */
  --cbrt-bg: #f9f9f9;              /* page/background feel */
  --cbrt-surface: #ffffff;         /* cards/boxes */
  --cbrt-surface2: #f4f5f7;        /* subtle panels */

  --cbrt-border: rgba(15, 23, 42, 0.10);
  --cbrt-border2: rgba(15, 23, 42, 0.16);

  --cbrt-text: #0f172a;
  --cbrt-muted: rgba(15, 23, 42, 0.70);
  --cbrt-muted2: rgba(15, 23, 42, 0.55);

  /* Accent: calm, not heavy */
  --cbrt-accent: #3b82f6;          /* blue-500 */
  --cbrt-accent-2: #2563eb;        /* blue-600 */
  --cbrt-accent-soft: rgba(59, 130, 246, 0.14);

  --cbrt-danger: #b42318;
  --cbrt-danger-soft: rgba(180, 35, 24, 0.10);

  --cbrt-radius: 16px;
  --cbrt-radius-sm: 12px;

  --cbrt-shadow: 0 10px 30px rgba(15, 23, 42, 0.07);
  --cbrt-shadow2: 0 6px 16px rgba(15, 23, 42, 0.07);

  --cbrt-font: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
}

/* ---------- Container ---------- */
.cbrt-wrap {
  font-family: var(--cbrt-font);
  color: var(--cbrt-text);
  background: var(--cbrt-bg);
  border: 1px solid var(--cbrt-border);
  border-radius: var(--cbrt-radius);
  padding: 18px;
  margin: 18px 0;
  box-shadow: var(--cbrt-shadow);
}

@media (min-width: 720px) {
  .cbrt-wrap { padding: 22px; }
}

.cbrt-header { margin-bottom: 14px; }

.cbrt-title {
  margin: 0 0 6px 0;
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: -0.015em;
}

@media (min-width: 720px) {
  .cbrt-title { font-size: 26px; }
}

.cbrt-intro {
  margin: 0 0 12px 0;
  color: var(--cbrt-muted);
  font-size: 14.5px;
  line-height: 1.5;
}

/* ---------- Disclaimers ---------- */
.cbrt-disclaimer {
  font-size: 13px;
  line-height: 1.4;
  padding: 12px 12px;
  border-radius: var(--cbrt-radius-sm);
  background: var(--cbrt-surface2);
  border: 1px solid var(--cbrt-border);
  color: var(--cbrt-muted);
}

.cbrt-disclaimer--short {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.cbrt-disclaimer--short::before {
  content: "ℹ︎";
  display: inline-flex;
  width: 22px;
  height: 22px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.05);
  border: 1px solid var(--cbrt-border);
  color: var(--cbrt-muted);
  flex: 0 0 auto;
  margin-top: 1px;
}

.cbrt-footer { margin-top: 16px; }

/* ---------- App + step header ---------- */
.cbrt-app { margin-top: 12px; }

.cbrt-stepHeader {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 4px 0 14px 0;
  padding: 12px;
  border-radius: var(--cbrt-radius-sm);
  background: var(--cbrt-surface2);
  border: 1px solid var(--cbrt-border);
}

@media (min-width: 720px) {
  .cbrt-stepHeader {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.cbrt-stepTitle {
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 0;
}

.cbrt-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 220px;
}

.cbrt-progressLabel {
  font-size: 12.5px;
  color: var(--cbrt-muted);
  white-space: nowrap;
}

.cbrt-progressBar {
  flex: 1 1 auto;
  height: 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.08);
  overflow: hidden;
  border: 1px solid var(--cbrt-border);
}

.cbrt-progressFill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--cbrt-accent), var(--cbrt-accent-2));
  transition: width 200ms ease;
}

/* ---------- Helper / messages ---------- */
.cbrt-lead {
  margin: 8px 0 12px 0;
  color: var(--cbrt-text);
  font-size: 14.5px;
  line-height: 1.55;
}

.cbrt-msg {
  margin: 0 0 12px 0;
  padding: 11px 12px;
  border-radius: var(--cbrt-radius-sm);
  border: 1px solid rgba(180, 35, 24, 0.28);
  background: var(--cbrt-danger-soft);
  color: #7a1a12;
  font-weight: 650;
}

/* ---------- Grid + option cards ---------- */
.cbrt-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

@media (min-width: 680px) {
  .cbrt-grid { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 980px) {
  .cbrt-grid { grid-template-columns: 1fr 1fr 1fr; }
}

.cbrt-cardWrap { position: relative; }

.cbrt-cardWrap input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

/* Card */
.cbrt-card {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding: 40px 12px 12px 12px;
    border-radius: var(--cbrt-radius-sm);
    border: 1px solid var(--cbrt-border);
    background: var(--cbrt-surface);
    cursor: pointer;
    user-select: none;
    transition: transform 80ms ease, border-color 120ms ease, box-shadow 120ms ease, background 120ms ease;
    position: relative;
    min-height: 88px;
}

.cbrt-card:hover {
  transform: translateY(-1px);
  border-color: var(--cbrt-border2);
  box-shadow: var(--cbrt-shadow2);
  background: rgba(15, 23, 42, 0.015);
}

.cbrt-cardLabel {
    display: block;
    font-size: 14px;
    line-height: 1.35;
    font-weight: 650;
    letter-spacing: -0.005em;
}

/* Focus ring */
.cbrt-cardWrap input[type="checkbox"]:focus + .cbrt-card {
  outline: 3px solid rgba(59, 130, 246, 0.18);
  outline-offset: 2px;
  border-color: rgba(59, 130, 246, 0.45);
}

/* Selected state */
.cbrt-cardWrap input[type="checkbox"]:checked + .cbrt-card {
  background: var(--cbrt-accent-soft);
  border-color: rgba(59, 130, 246, 0.45);
  box-shadow: 0 10px 22px rgba(59, 130, 246, 0.12);
}

/* Checkmark indicator */
.cbrt-card::after {
    content: "";
    position: absolute;
    top: 10px;
    left: 10px;
    /* moved from right to left */
    width: 18px;
    height: 18px;
    border-radius: 999px;
    border: 1px solid var(--cbrt-border);
    background: rgba(15, 23, 42, 0.03);
}

.cbrt-cardWrap input[type="checkbox"]:checked+.cbrt-card::after {
    content: "✓";
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    border-color: rgba(59, 130, 246, 0.55);
    background: #fff;
    color: var(--cbrt-accent-2);
}

/* ---------- Actions ---------- */
.cbrt-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--cbrt-border);
}

.cbrt-btn {
  border: 1px solid var(--cbrt-border);
  background: #fff;
  padding: 10px 14px;
  border-radius: 14px;
  cursor: pointer;
  font-weight: 750;
  font-size: 14px;
  letter-spacing: -0.005em;
  transition: transform 80ms ease, box-shadow 120ms ease, background 120ms ease, border-color 120ms ease;
}

.cbrt-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--cbrt-shadow2);
  border-color: var(--cbrt-border2);
}

.cbrt-btn:active { transform: translateY(0); }

/* Primary button: lighter than “near-black” */
.cbrt-btn--primary {
  background: linear-gradient(180deg, var(--cbrt-accent), var(--cbrt-accent-2));
  color: #fff;
  border-color: rgba(0,0,0,0);
}

.cbrt-btn--primary:hover {
  box-shadow: 0 14px 26px rgba(59, 130, 246, 0.22);
}

.cbrt-btn--ghost {
  background: rgba(15, 23, 42, 0.04);
}

@media (max-width: 520px) {
  .cbrt-btn { flex: 1 1 auto; }
}

/* ---------- Plan layout ---------- */
.cbrt-planTitle {
  margin: 6px 0 12px 0;
  font-size: 20px;
  letter-spacing: -0.01em;
}

.cbrt-summary {
  border: 1px solid var(--cbrt-border);
  background: var(--cbrt-surface2);
  border-radius: var(--cbrt-radius-sm);
  padding: 12px;
  margin-bottom: 12px;
}

.cbrt-summaryRow {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 10px;
  padding: 7px 0;
}

@media (max-width: 560px) {
  .cbrt-summaryRow { grid-template-columns: 1fr; gap: 4px; }
}

.cbrt-summaryLabel {
  font-weight: 850;
  font-size: 12.5px;
  color: var(--cbrt-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.cbrt-summaryValue { font-size: 14px; color: var(--cbrt-text); }

.cbrt-box {
  border: 1px solid var(--cbrt-border);
  border-radius: var(--cbrt-radius-sm);
  padding: 14px;
  background: var(--cbrt-surface);
  margin: 12px 0;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05);
}

.cbrt-box--muted { background: var(--cbrt-surface2); }

.cbrt-boxTitle {
  margin: 0 0 8px 0;
  font-size: 15.5px;
  letter-spacing: -0.01em;
}

.cbrt-note {
  margin: 0 0 12px 0;
  font-size: 13px;
  color: var(--cbrt-muted);
}

.cbrt-driver { margin: 12px 0; }

.cbrt-driverTitle {
  font-weight: 900;
  margin-bottom: 4px;
  letter-spacing: -0.01em;
}

.cbrt-driverText {
  color: var(--cbrt-muted);
  line-height: 1.55;
}

.cbrt-list { margin: 0; padding-left: 18px; }
.cbrt-list li { margin: 8px 0; line-height: 1.5; color: var(--cbrt-text); }

/* ---------- Noscript ---------- */
.cbrt-noscript {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px dashed var(--cbrt-border2);
  border-radius: var(--cbrt-radius-sm);
  background: var(--cbrt-surface2);
  color: var(--cbrt-muted);
}

/* ---------- Print ---------- */
@media print {
  .cbrt-actions,
  .cbrt-card,
  .cbrt-stepHeader,
  .cbrt-header .cbrt-disclaimer--short {
    display: none !important;
  }
  .cbrt-wrap {
    border: none;
    box-shadow: none;
    padding: 0;
    background: #fff;
  }
  .cbrt-box { box-shadow: none; }
}
