/* =========================================================================
   CCE Planner: styles
   Visual language taken 1:1 from the THREE C Biochar Production Calculation
   Tool (bpt-). Everything is scoped under .cce-root so the site theme
   cannot restyle it.
   ========================================================================= */

.cce-root {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  color: #2B2B2B;
  max-width: 1040px;
  margin: 0 auto;
  padding: 24px;
  box-sizing: border-box;
  line-height: 1.5;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  text-align: left;
}
.cce-root *,
.cce-root *::before,
.cce-root *::after {
  box-sizing: border-box;
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}
/* Reset for planner elements only; the embedded calculator (bpt-) keeps its own exact styles. */
.cce-root :where(h1, h2, h3, h4, p, ul, ol, dl, dd):not([class*="bpt-"]) {
  margin: 0;
  padding: 0;
}
.cce-root :where(button, input, select):not([class*="bpt-"]) {
  font-size: 14px;
  line-height: 1.4;
  text-transform: none;
  letter-spacing: normal;
  margin: 0;
}
.cce-hidden { display: none !important; }
.cce-sr {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* Header */
.cce-header { margin-bottom: 24px; }
.cce-header-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.cce-root .cce-title {
  color: #1D3A8F; font-size: 26px; font-weight: 700; line-height: 1.25;
  margin: 0 0 6px 0; letter-spacing: -0.01em;
}
.cce-intro { color: #2B2B2B; font-size: 14px; line-height: 1.45; max-width: 800px; }
.cce-account { display: flex; align-items: center; gap: 12px; font-size: 13px; color: #2B2B2B; padding-top: 6px; }
.cce-account strong { color: #1D3A8F; font-weight: 600; }

/* Notice banner (calculator disclaimer style) */
.cce-notice {
  background-color: #FFFBEB; border: 1px solid #FDE68A; border-left: 4px solid #D97706;
  border-radius: 8px; padding: 13px 16px; margin-bottom: 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.cce-root .cce-notice-title { font-size: 13px; font-weight: 700; color: #92400E; margin: 0 0 3px 0; line-height: 1.3; }
.cce-notice-text { font-size: 12.5px; line-height: 1.5; color: #78350F; }

/* Progress */
.cce-progress { margin-bottom: 16px; }
.cce-progress-top { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 13px; color: #2B2B2B; margin-bottom: 8px; }
.cce-progress-top strong { color: #1D3A8F; font-weight: 700; }
.cce-progress-track { height: 8px; background-color: #F0F2FA; border: 1px solid rgba(124, 136, 196, 0.35); border-radius: 6px; overflow: hidden; }
.cce-progress-fill { height: 100%; background-color: #2F5FE3; border-radius: 5px; transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1); }

/* Form card and sections */
.cce-form-card {
  background-color: #B4BFEF; border-radius: 8px; padding: 24px; margin-bottom: 24px;
  box-shadow: 0 2px 8px rgba(29, 58, 143, 0.08);
}
.cce-section {
  background-color: #FFFFFF; border-radius: 8px; padding: 18px 20px; margin-bottom: 14px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05); border: 1px solid rgba(124, 136, 196, 0.25); position: relative;
}
.cce-section:last-child { margin-bottom: 0; }
.cce-section-header { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.cce-section-title { color: #1D3A8F; font-size: 16px; font-weight: 600; margin: 0; line-height: 1.35; }
.cce-root .cce-help { font-size: 13px; color: #2B2B2B; margin: -4px 0 14px 0; line-height: 1.45; }

/* Info button + tooltip */
.cce-root .cce-info-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 17px; height: 17px; min-height: 0; border-radius: 50%;
  background-color: transparent; color: #1D3A8F; border: 1.5px solid #1D3A8F;
  font-size: 11px; font-weight: bold; cursor: pointer; padding: 0; line-height: 1;
  transition: background-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
  flex-shrink: 0; user-select: none; box-shadow: none;
}
.cce-root .cce-info-btn:hover,
.cce-root .cce-info-btn:focus,
.cce-root .cce-info-btn[aria-expanded="true"] {
  background-color: #1D3A8F; color: #FFFFFF; outline: none; transform: scale(1.08);
}
.cce-tooltip {
  background-color: #EBF1FF; color: #1D3A8F; font-size: 12.5px; line-height: 1.45;
  padding: 10px 14px; border-radius: 6px; border-left: 4px solid #1D3A8F;
  border-top: 1px solid rgba(29, 58, 143, 0.15); border-right: 1px solid rgba(29, 58, 143, 0.15);
  border-bottom: 1px solid rgba(29, 58, 143, 0.15); margin: -4px 0 14px 0;
  box-shadow: 0 2px 6px rgba(29, 58, 143, 0.08);
}

/* Grids and fields */
.cce-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.cce-field { margin-bottom: 14px; }
.cce-field:last-child { margin-bottom: 0; }
.cce-field-label { display: block; font-size: 13px; font-weight: 600; color: #2B2B2B; margin-bottom: 6px; }
.cce-field-hint { display: block; font-size: 12px; color: #475569; margin-top: 5px; }
.cce-input-wrapper {
  display: flex; align-items: center; background-color: #FFFFFF; border: 1px solid #7C88C4;
  border-radius: 4px; overflow: hidden; transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.cce-input-wrapper:focus-within { border-color: #2F5FE3; box-shadow: 0 0 0 2px rgba(47, 95, 227, 0.2); }
.cce-root .cce-input {
  flex: 1; border: none; padding: 10px 12px; font-size: 14px; font-weight: 500; color: #2B2B2B;
  outline: none; background: transparent; width: 100%; min-height: 40px; box-shadow: none; border-radius: 0;
}
.cce-root .cce-input::placeholder { color: #7C88C4; opacity: 0.8; }
.cce-dropdown-wrapper { position: relative; width: 100%; }
.cce-root .cce-select {
  width: 100%; appearance: none; -webkit-appearance: none; -moz-appearance: none;
  background-color: #FFFFFF; border: 1px solid #7C88C4; border-radius: 4px;
  padding: 10px 36px 10px 12px; font-size: 14px; color: #2B2B2B; font-weight: 500; line-height: 1.4;
  cursor: pointer; min-height: 42px; box-shadow: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.cce-root .cce-select:focus { outline: none; border-color: #2F5FE3; box-shadow: 0 0 0 2px rgba(47, 95, 227, 0.2); }
.cce-chevron-icon {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  pointer-events: none; width: 14px; height: 14px; color: #1D3A8F;
}
.cce-req { color: #D64545; font-weight: 700; margin-left: 3px; }
.cce-root .cce-req-note { font-size: 12px; color: #475569; margin: 0 0 12px 0; }
.cce-req-note .cce-req { margin: 0 3px 0 0; }

/* Password conditions */
.cce-root .cce-rules { list-style: none; margin: 10px 0 0 0; padding: 0; display: grid; gap: 4px; }
.cce-rule { font-size: 12.5px; color: #475569; line-height: 1.35; transition: color 0.15s ease; }
.cce-rule.is-met { color: #059669; font-weight: 600; }

.cce-check { display: flex; align-items: flex-start; gap: 10px; font-size: 13px; color: #2B2B2B; line-height: 1.45; cursor: pointer; }
.cce-root .cce-check input[type="checkbox"] {
  -webkit-appearance: none; appearance: none; flex: none; width: 18px; height: 18px; margin: 0; padding: 0;
  background-color: #FFFFFF; border: 1.5px solid #7C88C4; border-radius: 3px; cursor: pointer; box-shadow: none;
  background-position: center; background-repeat: no-repeat; background-size: 12px 12px;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.cce-root .cce-check input[type="checkbox"]:hover { border-color: #2F5FE3; }
.cce-root .cce-check input[type="checkbox"]:focus-visible { outline: none; border-color: #2F5FE3; box-shadow: 0 0 0 2px rgba(47, 95, 227, 0.2); }
.cce-root .cce-check input[type="checkbox"]:checked {
  background-color: #2F5FE3; border-color: #2F5FE3;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
}
.cce-check a, .cce-root .cce-text-link { color: #2F5FE3; font-weight: 600; text-decoration: underline; }

/* Pill toggle (calculator volume / mass toggle) */
.cce-toggle-group { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.cce-pills {
  display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  background-color: #FFFFFF; border: 1px solid #7C88C4; border-radius: 20px; overflow: hidden;
}
.cce-root .cce-pill {
  display: block; text-align: center; white-space: nowrap; padding: 6px 16px; border: 0; border-radius: 0; background: transparent;
  font-size: 13px; font-weight: 600; color: #1D3A8F; cursor: pointer; min-height: 0; box-shadow: none;
  transition: background-color 0.2s ease, color 0.2s ease;
}
.cce-root .cce-pill[aria-pressed="true"] { background-color: #2F5FE3; color: #FFFFFF; }
.cce-root .cce-pill:focus-visible { outline: 2px solid #1D3A8F; outline-offset: -2px; }

/* Option tiles (single and multiple choice) */
.cce-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.cce-options-compact { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.cce-root .cce-option {
  display: flex; align-items: flex-start; gap: 12px; width: 100%; text-align: left;
  background-color: #FFFFFF; border: 1px solid #7C88C4; border-radius: 4px; padding: 12px 14px;
  cursor: pointer; color: #2B2B2B; min-height: 44px; box-shadow: none; font-weight: 400;
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}
.cce-root .cce-option:hover { border-color: #2F5FE3; }
.cce-root .cce-option:focus-visible { outline: none; border-color: #2F5FE3; box-shadow: 0 0 0 2px rgba(47, 95, 227, 0.2); }
.cce-root .cce-option[aria-pressed="true"] { border-color: #2F5FE3; background-color: #EBF1FF; box-shadow: inset 0 0 0 1px #2F5FE3; }
.cce-option-mark {
  flex: none; width: 18px; height: 18px; margin-top: 1px; border: 1.5px solid #7C88C4; background: #FFFFFF;
  display: inline-flex; align-items: center; justify-content: center;
}
.cce-option-mark.is-radio { border-radius: 50%; }
.cce-option-mark.is-check { border-radius: 3px; }
.cce-option[aria-pressed="true"] .cce-option-mark { border-color: #2F5FE3; background: #2F5FE3; }
.cce-option[aria-pressed="true"] .cce-option-mark.is-radio { background: #FFFFFF; box-shadow: inset 0 0 0 4px #2F5FE3; }
.cce-option-mark svg { width: 12px; height: 12px; color: #FFFFFF; }
.cce-option-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cce-option-title { font-size: 14px; font-weight: 600; color: #1D3A8F; }
.cce-option-desc { font-size: 12.5px; color: #475569; line-height: 1.45; }

/* Lists (stakeholders) */
.cce-root .cce-list { list-style: none; display: grid; gap: 8px; margin-bottom: 14px; }
.cce-list-item {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px 14px; border: 1px solid rgba(124, 136, 196, 0.45); border-radius: 4px; background: #FFFFFF;
}
.cce-list-item strong { color: #2B2B2B; font-weight: 600; }
.cce-tag {
  display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 9999px;
  background-color: #E0E7FF; color: #1E44B8; letter-spacing: 0.02em; margin-left: 8px; vertical-align: 1px;
}
.cce-root .cce-empty { font-size: 13px; color: #475569; padding: 10px 14px; border: 1px dashed #7C88C4; border-radius: 4px; margin-bottom: 14px; background: #F0F2FA; }
.cce-add-row { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr) auto; gap: 12px; align-items: end; }

/* Buttons */
.cce-actions {
  display: flex; gap: 16px; margin-top: 24px; padding-top: 16px;
  border-top: 1px solid rgba(124, 136, 196, 0.3);
}
.cce-root .cce-btn {
  padding: 12px 24px; font-size: 15px; font-weight: 600; border-radius: 4px; cursor: pointer;
  text-align: center; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  line-height: 1.3; text-decoration: none; min-height: 44px;
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}
.cce-root .cce-btn[disabled] { opacity: 0.6; cursor: wait; }
.cce-root .cce-btn-primary {
  flex: 1; background-color: #2F5FE3; color: #FFFFFF; border: 1px solid #2F5FE3;
  box-shadow: 0 2px 4px rgba(47, 95, 227, 0.15);
}
.cce-root .cce-btn-primary:hover, .cce-root .cce-btn-primary:focus { background-color: #1E44B8; border-color: #1E44B8; color: #FFFFFF; }
.cce-root .cce-btn-secondary { flex: 1; background-color: #FFFFFF; color: #2F5FE3; border: 1px solid #2F5FE3; box-shadow: none; }
.cce-root .cce-btn-secondary:hover, .cce-root .cce-btn-secondary:focus { background-color: #F0F4FF; color: #1E44B8; border-color: #1E44B8; }
.cce-root .cce-btn-small { flex: none; padding: 10px 18px; font-size: 14px; min-height: 42px; }
.cce-root .cce-btn:focus-visible { outline: 2px solid #1D3A8F; outline-offset: 2px; }
.cce-root .cce-link-btn {
  background: none; border: 0; padding: 0; color: #2F5FE3; font-weight: 600; font-size: 13px;
  cursor: pointer; text-decoration: underline; min-height: 0; box-shadow: none;
}
.cce-root .cce-link-btn:hover { color: #1E44B8; }
.cce-switch { font-size: 13px; color: #2B2B2B; margin-top: 14px; }

/* Error banner */
.cce-error-banner {
  background-color: #FDEDED; color: #D64545; border-left: 4px solid #D64545;
  border-top: 1px solid rgba(214, 69, 69, 0.2); border-right: 1px solid rgba(214, 69, 69, 0.2);
  border-bottom: 1px solid rgba(214, 69, 69, 0.2); border-radius: 4px; padding: 10px 14px;
  font-size: 13px; font-weight: 600; margin-top: 14px;
}

/* Results card (calculator green) */
.cce-results-card {
  background-color: #CDE59A; border-radius: 12px; padding: 24px; margin-bottom: 24px;
  border: 2px solid #A8C96C; box-shadow: 0 4px 12px rgba(29, 58, 143, 0.08);
}
.cce-results-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; flex-wrap: wrap; gap: 12px; }
.cce-results-title { color: #1D3A8F; font-size: 20px; font-weight: 700; margin: 0; }
.cce-results-badge {
  background-color: #1D3A8F; color: #FFFFFF; font-size: 11px; font-weight: 600; padding: 4px 10px;
  border-radius: 4px; text-transform: uppercase; letter-spacing: 0.05em;
}
.cce-metrics-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.cce-metric-card { background: rgba(255, 255, 255, 0.4); border-radius: 8px; padding: 14px 16px; border: 1px solid rgba(29, 58, 143, 0.12); }
.cce-root .cce-metric-label { font-size: 12px; font-weight: 600; color: #2B2B2B; margin: 0 0 6px 0; }
.cce-metric-value { color: #1D3A8F; font-size: 18px; font-weight: 700; line-height: 1.3; }
.cce-metric-sub { color: #1D3A8F; font-size: 13px; font-weight: 500; opacity: 0.85; margin-top: 2px; }

/* Numbered plan steps */
.cce-root .cce-steps { list-style: none; display: grid; gap: 10px; counter-reset: cce-step; }
.cce-steps li {
  counter-increment: cce-step; display: grid; grid-template-columns: 28px 1fr; gap: 12px; align-items: start;
  padding: 12px 14px; border: 1px solid rgba(124, 136, 196, 0.45); border-radius: 4px; background: #FFFFFF;
}
.cce-steps li::before {
  content: counter(cce-step); width: 26px; height: 26px; border-radius: 4px; background: #1D3A8F; color: #FFFFFF;
  font-size: 13px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center;
}
.cce-steps strong { display: block; color: #1D3A8F; font-size: 14px; font-weight: 600; }
.cce-steps span { font-size: 12.5px; color: #475569; }

/* Loading */
.cce-loading { padding: 40px 0; text-align: center; color: #1D3A8F; font-weight: 600; }

/* Single-column stacking below 900px (calculator breakpoint) */
@media (max-width: 900px) {
  .cce-root { padding: 16px; }
  .cce-form-card, .cce-results-card { padding: 18px; }
  .cce-grid-2, .cce-metrics-grid, .cce-add-row { grid-template-columns: 1fr; }
  .cce-actions { flex-direction: column-reverse; }
  .cce-root .cce-btn-primary, .cce-root .cce-btn-secondary { width: 100%; flex: none; }
  .cce-title { font-size: 22px; }
  .cce-results-title { font-size: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .cce-root * { transition: none !important; }
}

/* Embedded production calculator: sits flush inside the planner */
.cce-root .bpt-container { padding: 0; max-width: none; margin: 0 0 24px 0; }

/* Plan overview rows */
.cce-step-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.cce-step-row > div { flex: 1 1 260px; min-width: 0; }
.cce-step-row .cce-tag { margin-left: 0; }
.cce-tag-done { background-color: #D1FAE5; color: #065F46; }

/* "Use these results in my plan" card */
.cce-plan-card {
  background: #FFFFFF; border: 2px solid #2F5FE3; border-radius: 12px; padding: 20px 24px; margin-bottom: 24px;
  box-shadow: 0 4px 12px rgba(29, 58, 143, 0.08);
}
.cce-root .cce-plan-figures { color: #1D3A8F; font-size: 20px; font-weight: 700; line-height: 1.3; margin: 0 0 6px 0; }
.cce-plan-card .cce-help { margin: 0 0 4px 0; }
.cce-plan-card .cce-actions { margin-top: 16px; }
.cce-root .cce-btn[disabled][aria-disabled="true"] { cursor: not-allowed; }
@media (max-width: 900px) { .cce-plan-card { padding: 18px; } .cce-root .cce-plan-figures { font-size: 18px; } }
