/* ── Tokens ─────────────────────────────────────────────── */
.chpc {
  --brand:          var(--chpc-brand, #41b97f);
  --brand-h:        var(--chpc-brand-h, 155);
  --bg:             oklch(98.5% 0.005 var(--brand-h));
  --surface:        oklch(100% 0 0);
  --surface-raised: oklch(99% 0.003 var(--brand-h));
  --text-primary:   oklch(18% 0.01 var(--brand-h));
  --text-muted:     oklch(52% 0.01 var(--brand-h));
  --border:         oklch(88% 0.008 var(--brand-h));
  --brand-tint:     oklch(96% 0.012 var(--brand-h));
  --brand-text:     oklch(32% 0.09 var(--brand-h));

  --space-xs:  4px;
  --space-sm:  8px;
  --space-md:  16px;
  --space-lg:  24px;
  --space-xl:  32px;
  --space-2xl: 48px;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;

  font-family: 'Poppins', system-ui, sans-serif;
  font-size: 15px;
  color: var(--text-primary);
  background: var(--bg);
  line-height: 1.6;
  box-sizing: border-box;
}

.chpc *, .chpc *::before, .chpc *::after { box-sizing: inherit; }

/* ── Layout ─────────────────────────────────────────────── */
.chpc-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-lg);
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--space-lg) var(--space-md);
}

@media (min-width: 900px) {
  .chpc-layout {
    grid-template-columns: 3fr 2fr;
    align-items: start;
    padding: var(--space-2xl) var(--space-lg);
    gap: var(--space-2xl);
  }
}

/* ── Form ───────────────────────────────────────────────── */
.chpc-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
}

.chpc-step {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
}

.chpc-step-title {
  font-family: 'Montserrat', 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-primary);
  margin: 0 0 var(--space-md);
  line-height: 1.3;
}

.chpc-step-subtitle {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: calc(-1 * var(--space-sm)) 0 var(--space-md);
}

/* ── Model Tabs ─────────────────────────────────────────── */
.chpc-model-tabs {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.chpc-model-tab {
  font-family: 'Poppins', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  padding: var(--space-sm) var(--space-lg);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  transition: border-color 200ms ease-out, background 200ms ease-out, color 200ms ease-out;
}

.chpc-model-tab:hover {
  border-color: var(--brand);
  color: var(--text-primary);
}

.chpc-model-tab.active {
  background: var(--brand-tint);
  border-color: var(--brand);
  color: var(--brand-text);
}

/* ── Fields ─────────────────────────────────────────────── */
.chpc-field-group {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--space-md);
}

.chpc-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.chpc-field label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.01em;
}

.chpc-field input[type="number"],
.chpc-field select {
  font-family: 'Poppins', sans-serif;
  font-size: 0.95rem;
  padding: var(--space-sm) var(--space-md);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-primary);
  appearance: none;
  -webkit-appearance: none;
  transition: border-color 150ms ease-out;
  width: 100%;
}

.chpc-field input[type="number"]:focus,
.chpc-field select:focus {
  outline: none;
  border-color: var(--brand);
}

.chpc-field-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin: 0;
}

.chpc-field-hint.chpc-warning { color: oklch(50% 0.12 50); font-weight: 500; }
.chpc-field-hint.chpc-info    { color: var(--brand-text); }

.chpc-muted { color: var(--text-muted); font-weight: 400; }

/* ── Add-Ons ─────────────────────────────────────────────── */
.chpc-addons {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.chpc-addon-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  background: var(--surface-raised);
  gap: var(--space-md);
}

.chpc-addon-label {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex: 1;
  font-size: 0.9rem;
  font-weight: 500;
}

.chpc-addon-price {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Toggle switch */
.chpc-toggle {
  position: relative;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
  cursor: pointer;
}

.chpc-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.chpc-toggle-track {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: 999px;
  transition: background 200ms ease-out;
}

.chpc-toggle input:checked ~ .chpc-toggle-track { background: var(--brand); }

.chpc-toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  background: white;
  border-radius: 50%;
  transition: transform 200ms ease-out;
  pointer-events: none;
}

.chpc-toggle input:checked ~ .chpc-toggle-track .chpc-toggle-thumb {
  transform: translateX(18px);
}

/* ── Checkboxes ──────────────────────────────────────────── */
.chpc-check-row { margin-top: var(--space-md); }

.chpc-checkbox-label {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
}

.chpc-consult-note {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: var(--space-xs) 0 0 var(--space-xl);
  font-style: italic;
}

/* ── Backup sub-sections ─────────────────────────────────── */
.chpc-backup-detail {
  margin-top: var(--space-md);
  padding: var(--space-md);
  background: var(--surface-raised);
  border-radius: var(--radius-sm);
}

.chpc-sub-heading {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  margin: 0 0 var(--space-md);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ── Badges ──────────────────────────────────────────────── */
.chpc-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  letter-spacing: 0.02em;
}

.chpc-badge-brand    { background: var(--brand-tint); color: var(--brand-text); }
.chpc-badge-info     { background: oklch(95% 0.008 220); color: oklch(35% 0.06 220); }
.chpc-badge-loose    { background: oklch(96% 0.05 75); color: oklch(40% 0.1 75); }
.chpc-badge-included { background: oklch(95% 0.01 145); color: oklch(35% 0.08 145); }

/* ── Callout ─────────────────────────────────────────────── */
.chpc-callout {
  background: var(--brand-tint);
  border-radius: var(--radius-sm);
  padding: var(--space-md);
  font-size: 0.875rem;
  line-height: 1.5;
  margin-top: var(--space-md);
}

.chpc-callout-panel { margin-top: var(--space-md); }
.chpc-callout strong { color: var(--brand-text); }

/* ── Estimate Panel ──────────────────────────────────────── */
.chpc-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

@media (min-width: 900px) {
  .chpc-panel { position: sticky; top: 24px; }
}

.chpc-panel-inner {
  padding: var(--space-xl);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.chpc-panel-header { display: flex; flex-direction: column; gap: var(--space-xs); }

.chpc-panel-title {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 0.75rem;
  margin: 0;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.chpc-estimate-rows { display: flex; flex-direction: column; gap: var(--space-xs); }

.chpc-estimate-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  color: var(--text-muted);
  padding: var(--space-xs) 0;
}

.chpc-total-row {
  display: flex;
  align-items: baseline;
  gap: var(--space-sm);
  padding: var(--space-md) 0;
  border-top: 1.5px solid var(--border);
  border-bottom: 1.5px solid var(--border);
  flex-wrap: wrap;
}

.chpc-total-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  width: 100%;
}

.chpc-total-value {
  font-family: 'Montserrat', sans-serif;
  font-weight: 800;
  font-size: 3.5rem;
  line-height: 1;
  color: var(--brand);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.chpc-total-unit {
  font-size: 0.9rem;
  color: var(--text-muted);
  align-self: flex-end;
  padding-bottom: 4px;
}

/* ── Blueprint ───────────────────────────────────────────── */
.chpc-blueprint-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: none;
  border: none;
  border-top: 1px solid var(--border);
  padding: var(--space-md) 0 0;
  cursor: pointer;
  font-family: 'Poppins', sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  text-align: left;
}

.chpc-chevron { transition: transform 200ms ease-out; flex-shrink: 0; }
.chpc-blueprint-toggle[aria-expanded="true"] .chpc-chevron { transform: rotate(180deg); }

.chpc-blueprint-body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 250ms ease-out;
  overflow: hidden;
}

.chpc-blueprint-body.open { grid-template-rows: 1fr; }
.chpc-blueprint-body > * { min-height: 0; }

.chpc-phases {
  list-style: none;
  margin: var(--space-md) 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.chpc-phase {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: var(--space-sm);
  align-items: start;
}

.chpc-phase-num {
  font-family: 'Montserrat', sans-serif;
  font-weight: 800;
  font-size: 0.75rem;
  color: var(--brand);
  line-height: 1.6;
}

.chpc-phase-content { display: flex; flex-direction: column; gap: 2px; }
.chpc-phase-label   { font-weight: 600; font-size: 0.875rem; }
.chpc-phase-desc    { font-size: 0.78rem; color: var(--text-muted); }

.chpc-phase-note {
  font-size: 0.75rem;
  color: var(--brand-text);
  background: var(--brand-tint);
  border-radius: var(--radius-sm);
  padding: 3px 8px;
  margin-top: 2px;
  display: inline-block;
}

/* ── CTAs ────────────────────────────────────────────────── */
.chpc-cta-row { display: flex; gap: var(--space-sm); flex-wrap: wrap; }

.chpc-btn {
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 0.875rem;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  transition: opacity 150ms ease-out, background 150ms ease-out;
}

.chpc-btn-primary { background: var(--brand); color: white; }
.chpc-btn-primary:hover { opacity: 0.88; }

.chpc-btn-ghost {
  background: transparent;
  color: var(--brand-text);
  box-shadow: inset 0 0 0 1.5px var(--brand);
}

.chpc-btn-ghost:hover { background: var(--brand-tint); }

.chpc-email-form { display: flex; gap: var(--space-sm); }

.chpc-email-form input[type="email"] {
  flex: 1;
  font-family: 'Poppins', sans-serif;
  font-size: 0.875rem;
  padding: var(--space-sm) var(--space-md);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-primary);
}

.chpc-email-form input[type="email"]:focus {
  outline: none;
  border-color: var(--brand);
}

.chpc-disclaimer {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: 0;
  font-style: italic;
}

/* ── Project path ─────────────────────────────────────────── */
.chpc-project-estimate {
  margin-top: var(--space-md);
  padding: var(--space-md);
  background: var(--surface-raised);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  line-height: 1.8;
}

.chpc-project-estimate strong {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  color: var(--brand);
}

/* ── Mobile bar ──────────────────────────────────────────── */
.chpc-mobile-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: var(--space-sm) var(--space-lg);
  align-items: center;
  gap: var(--space-md);
  z-index: 100;
}

@media (max-width: 899px) {
  .chpc-mobile-bar { display: flex; }
  .chpc-panel { display: none; }
  .chpc-layout { padding-bottom: 72px; }
}

.chpc-mobile-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.chpc-mobile-total {
  font-family: 'Montserrat', sans-serif;
  font-weight: 800;
  font-size: 1.4rem;
  color: var(--brand);
  flex: 1;
}
