/* ==========================================================================
   Open Enterprise: Pricing Estimator
   Colors from the official brand sheet: navy #1F2E57, green gradient
   #AED791 (light) -> #007A45 (dark). Single theme.
   Everything is scoped under .oe-est so this can be pasted into
   the existing site without fighting global styles.
   ========================================================================== */

:root {
  --oe-font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", Roboto, Helvetica, Arial, sans-serif;
  --oe-font-figure: "IBM Plex Mono", "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  --oe-radius: 10px;
  --oe-radius-sm: 6px;

  --oe-navy: #1f2e57;
  --oe-green-light: #aed791;
  --oe-green-dark: #007a45;
  --oe-green-mid: #158f5f;

  --oe-bg: #f6f8fc;
  --oe-panel: #ffffff;
  --oe-panel-alt: #eef1f8;
  --oe-border: rgba(35, 47, 102, 0.14);
  --oe-border-strong: rgba(35, 47, 102, 0.24);
  --oe-ink: #1b2242;
  --oe-ink-heading: var(--oe-navy);
  --oe-ink-muted: #5a6180;
  --oe-ink-faint: #8a90ab;
  --oe-accent: var(--oe-green-mid);
  --oe-accent-strong: var(--oe-green-dark);
  --oe-accent-contrast: #ffffff;
  --oe-summary-grad: linear-gradient(165deg, #ffffff, #eef2fa 70%);
  --oe-focus: #0f7a52;
}

/* --------------------------------------------------------------------------
   Component shell
   -------------------------------------------------------------------------- */
.oe-est {
  box-sizing: border-box;
  max-width: 1040px;
  margin: 0 auto;
  padding: 40px 24px 96px;
  font-family: var(--oe-font-ui);
  color: var(--oe-ink);
}
.oe-est *, .oe-est *::before, .oe-est *::after { box-sizing: border-box; }
.oe-est [hidden] { display: none !important; }

.oe-est__intro {
  max-width: 640px;
  margin: 0 0 44px;
}
.oe-est__heading {
  margin: 0 0 12px;
  font-size: clamp(28px, 3.4vw, 38px);
  line-height: 1.15;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: var(--oe-ink-heading);
}
.oe-est__sub {
  margin: 0;
  font-size: 16px;
  line-height: 1.6;
  color: var(--oe-ink-muted);
  max-width: 52ch;
}

.oe-est__body {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 28px;
  align-items: start;
}

/* ---- Form / questions ---- */
.oe-est__form {
  counter-reset: oe-q;
  overflow: hidden; /* contains the nudge highlight's side bleed */
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--oe-panel);
  border: 1px solid var(--oe-border);
  border-radius: var(--oe-radius);
  padding: 8px 28px;
}

.oe-est__field {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 24px 0;
  border-bottom: 1px solid var(--oe-border);
}
.oe-est__field:last-child { border-bottom: none; }

/* "5 quick questions" header at the top of the card */
.oe-est__form-head {
  margin: 0;
  padding: 20px 0 0;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--oe-accent-strong);
}

/* Numbered questions. The connections checklist is a sub-step of
   question 4, so it isn't counted. Answered questions show a check. */
.oe-est__field:not(.oe-est__field--conditional) { counter-increment: oe-q; }
.oe-est__field:not(.oe-est__field--conditional) > .oe-est__field-head > label::before {
  content: counter(oe-q);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin-right: 10px;
  border-radius: 50%;
  border: 1.5px solid var(--oe-accent-strong);
  color: var(--oe-accent-strong);
  font-size: 12px;
  font-weight: 700;
  vertical-align: 1px;
  transition: background 160ms ease, color 160ms ease;
}
/* Check drawn as an SVG, not a font glyph, so it renders on every device */
/* Same :not() as the number rule above so this wins on specificity;
   otherwise the number keeps rendering underneath the check. */
.oe-est__field--answered:not(.oe-est__field--conditional) > .oe-est__field-head > label::before {
  content: "";
  background: var(--oe-accent-strong) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 6.3l2.3 2.3 4.7-4.9' fill='none' stroke='%23fff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 12px no-repeat;
}
.oe-est__field:not(.oe-est__field--conditional) > .oe-est__field-head > .oe-est__hint { padding-left: 32px; }
.oe-est__field--stack { grid-template-columns: 1fr; }

.oe-est__field--conditional { animation: oe-est-reveal 240ms ease; }
@keyframes oe-est-reveal {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.oe-est__field-head {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}
.oe-est__field-head label {
  font-size: 15px;
  font-weight: 600;
  color: var(--oe-ink);
}
.oe-est__hint {
  font-size: 13px;
  line-height: 1.5;
  color: var(--oe-ink-faint);
  max-width: 52ch;
}

/* Stepper (number fields) */
.oe-est__stepper {
  display: inline-flex;
  align-items: stretch;
  border: 1.5px solid var(--oe-accent-strong);
  border-radius: var(--oe-radius-sm);
  overflow: hidden;
  flex-shrink: 0;
}
.oe-est__step-btn {
  width: 42px;
  min-height: 42px;
  border: none;
  background: var(--oe-panel);
  color: var(--oe-accent-strong);
  font-weight: 600;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: background 120ms ease;
}
.oe-est__step-btn:hover { background: color-mix(in srgb, var(--oe-accent) 14%, var(--oe-panel)); }
.oe-est__step-btn:active { background: var(--oe-accent); color: var(--oe-accent-contrast); }

.oe-est__stepper input {
  width: 56px;
  font-weight: 600;
  border: none;
  border-left: 1px solid var(--oe-border);
  border-right: 1px solid var(--oe-border);
  background: var(--oe-panel);
  color: var(--oe-ink);
  text-align: center;
  font-family: var(--oe-font-figure);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  -moz-appearance: textfield;
}
.oe-est__stepper input::-webkit-outer-spin-button,
.oe-est__stepper input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Toggle (yes/no fields) */
.oe-est__toggle {
  display: inline-flex;
  border: 1.5px solid var(--oe-accent-strong);
  border-radius: var(--oe-radius-sm);
  overflow: hidden;
  flex-shrink: 0;
}
.oe-est__toggle-btn {
  min-width: 72px;
  padding: 11px 18px;
  border: none;
  background: var(--oe-panel);
  color: var(--oe-accent-strong);
  font-family: var(--oe-font-ui);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease;
}
.oe-est__toggle-btn + .oe-est__toggle-btn { border-left: 1.5px solid var(--oe-accent-strong); }
.oe-est__toggle-btn:hover { background: color-mix(in srgb, var(--oe-accent) 14%, var(--oe-panel)); }
/* Once one side is chosen, the other side recedes */
.oe-est__toggle:has([aria-pressed="true"]) .oe-est__toggle-btn[aria-pressed="false"] { color: var(--oe-ink-muted); }
.oe-est__toggle-btn[aria-pressed="true"] {
  background: var(--oe-accent);
  color: var(--oe-accent-contrast);
}
.oe-est__toggle-btn:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}
.oe-est__toggle--locked {
  cursor: not-allowed;
  border-color: var(--oe-border-strong);
}
.oe-est__toggle--locked .oe-est__toggle-btn + .oe-est__toggle-btn { border-left-color: var(--oe-border-strong); }
.oe-est__toggle--locked .oe-est__toggle-btn { color: var(--oe-ink-faint); }

/* Data connections checklist */
.oe-est__conn-cap-note {
  margin: 2px 0 12px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--oe-accent-strong);
  min-height: 1em;
}
.oe-est__conn-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.oe-est__conn-grid--locked {
  cursor: not-allowed;
}
.oe-est__conn-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--oe-border);
  border-radius: var(--oe-radius-sm);
  background: var(--oe-panel-alt);
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease, opacity 120ms ease;
}
.oe-est__conn-item:has(input:checked) {
  border-color: var(--oe-accent-strong);
  background: color-mix(in srgb, var(--oe-accent) 14%, var(--oe-panel-alt));
}
.oe-est__conn-item:has(input:disabled) {
  opacity: 0.45;
  cursor: not-allowed;
}
.oe-est__conn-item input {
  accent-color: var(--oe-accent-strong);
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.oe-est__conn-name {
  flex: 1;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--oe-ink);
}
.oe-est__conn-name small { color: var(--oe-ink-faint); font-weight: 400; }
.oe-est__conn-price {
  font-family: var(--oe-font-figure);
  font-size: 12.5px;
  color: var(--oe-ink-muted);
  flex-shrink: 0;
}

/* Keyboard focus visibility across all interactive controls */
.oe-est__step-btn:focus-visible,
.oe-est__toggle-btn:focus-visible,
.oe-est__stepper input:focus-visible,
.oe-est__conn-item input:focus-visible,
.oe-est__cta-primary:focus-visible,
.oe-est__cta-secondary:focus-visible,
.oe-est__faq-anchor:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--oe-focus);
  outline-offset: 2px;
}

/* ---- Summary ---- */
.oe-est__summary {
  position: sticky;
  top: 24px;
}
.oe-est__summary-inner {
  background: var(--oe-summary-grad);
  border: 1px solid var(--oe-border-strong);
  border-radius: var(--oe-radius);
  padding: 28px;
}

.oe-est__lines {
  margin: 0 0 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.oe-est__line {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin: 0;
  font-size: 14px;
}
.oe-est__line dt { color: var(--oe-ink-muted); font-weight: 400; }

/* Flash a summary row when its amount changes (class set by estimator.js) */
.oe-est__line--changed { animation: oe-est-flash 900ms ease-out; border-radius: 4px; }
@keyframes oe-est-flash {
  from { background: color-mix(in srgb, var(--oe-accent) 22%, transparent); box-shadow: 0 0 0 6px color-mix(in srgb, var(--oe-accent) 22%, transparent); }
  to { background: transparent; box-shadow: 0 0 0 6px transparent; }
}
.oe-est__line dd {
  margin: 0;
  font-family: var(--oe-font-figure);
  font-variant-numeric: tabular-nums;
  color: var(--oe-ink);
}

.oe-est__total {
  padding: 18px 0;
  border-top: 1px solid var(--oe-border-strong);
  border-bottom: 1px solid var(--oe-border-strong);
}
.oe-est__total-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-bottom: 8px;
}
.oe-est__total-label {
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--oe-ink-heading);
}
.oe-est__progress {
  padding: 3px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, #9cdbf0 45%, var(--oe-panel));
  color: var(--oe-navy);
  font-size: 12px;
  font-weight: 600;
  transition: background 200ms ease, color 200ms ease;
}
/* Before any answer: an instruction line, not a count badge */
.oe-est__progress--prompt {
  flex-basis: 100%;
  order: 2;
  padding: 0;
  border-radius: 0;
  background: none;
  color: var(--oe-accent-strong);
  font-size: 14px;
  font-weight: 650;
}
.oe-est__progress--done {
  background: var(--oe-accent-strong);
  color: #ffffff;
}
.oe-est__total-monthly {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
}
.oe-est__total-prefix {
  font-size: 15px;
  color: var(--oe-ink-muted);
}
.oe-est__total-figure {
  font-family: var(--oe-font-figure);
  transition: font-size 260ms ease, color 260ms ease;
  font-size: 40px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--oe-ink-heading);
  letter-spacing: -0.01em;
}
/* Incomplete: the figure reads as a draft until all questions are answered */
.oe-est__total--provisional .oe-est__total-figure {
  font-size: 30px;
  color: var(--oe-ink-faint);
}
.oe-est__total-unit {
  font-size: 15px;
  color: var(--oe-ink-muted);
}
.oe-est__total-annual {
  margin-top: 6px;
  font-size: 13px;
  color: var(--oe-ink-faint);
}
.oe-est__total-annual span { color: var(--oe-ink-muted); font-family: var(--oe-font-figure); font-variant-numeric: tabular-nums; }

.oe-est__disclaimer {
  margin: 16px 0 0;
  font-size: 12px;
  line-height: 1.55;
  color: var(--oe-ink-faint);
}

.oe-est__cta {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--oe-border);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}
.oe-est__cta-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 20px;
  border-radius: var(--oe-radius-sm);
  background: linear-gradient(135deg, var(--oe-green-light), var(--oe-green-dark));
  color: #ffffff;
  font-size: 15px;
  font-weight: 650;
  text-decoration: none;
  text-align: center;
  transition: filter 140ms ease, transform 140ms ease;
}
.oe-est__cta-primary:hover { filter: brightness(1.08); }
.oe-est__cta-primary:active { transform: translateY(1px); }

.oe-est__cta-secondary {
  text-align: center;
  font-size: 13px;
  color: var(--oe-ink-faint);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.oe-est__cta-secondary:hover { color: var(--oe-ink-muted); }

/* --------------------------------------------------------------------------
   Arrival nudge: .oe-est--nudge is added once by estimator.js when the
   form first scrolls into view untouched, then removed.
   -------------------------------------------------------------------------- */
.oe-est--nudge .oe-est__form > .oe-est__field:first-of-type {
  animation: oe-est-nudge-field 2400ms ease-out;
}
.oe-est--nudge .oe-est__form > .oe-est__field:first-of-type .oe-est__stepper {
  animation: oe-est-nudge-ring 1200ms ease-out 350ms;
}
@keyframes oe-est-nudge-field {
  0%, 100% { background: transparent; box-shadow: -28px 0 0 transparent, 28px 0 0 transparent; }
  20% {
    background: color-mix(in srgb, var(--oe-accent) 9%, transparent);
    box-shadow: -28px 0 0 color-mix(in srgb, var(--oe-accent) 9%, transparent), 28px 0 0 color-mix(in srgb, var(--oe-accent) 9%, transparent);
  }
}
@keyframes oe-est-nudge-ring {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--oe-accent) 55%, transparent); }
  100% { box-shadow: 0 0 0 12px transparent; }
}

/* --------------------------------------------------------------------------
   FAQ
   -------------------------------------------------------------------------- */
.oe-est__faq {
  margin-top: 56px;
  max-width: 760px;
}
.oe-est__faq-item {
  border-bottom: 1px solid var(--oe-border);
}
.oe-est__faq-item summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 4px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 550;
  color: var(--oe-ink);
}
.oe-est__faq-item summary::-webkit-details-marker { display: none; }
.oe-est__faq-item summary::before {
  content: "+";
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  order: -1;
  color: var(--oe-accent-strong);
  font-size: 17px;
  font-weight: 400;
  transition: transform 160ms ease;
}
.oe-est__faq-item[open] summary::before {
  content: "–";
}
.oe-est__faq-q { flex: 1; }
.oe-est__faq-anchor {
  flex-shrink: 0;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 13px;
  opacity: 0.45;
  padding: 4px;
  transition: opacity 120ms ease;
}
.oe-est__faq-anchor:hover { opacity: 1; }
/* Smooth open/close where the browser can animate to height:auto
   (Chromium today). Elsewhere answers open instantly, as before. */
@supports (interpolate-size: allow-keywords) {
  .oe-est__faq-item { interpolate-size: allow-keywords; }
  .oe-est__faq-item::details-content {
    block-size: 0;
    overflow: hidden;
    transition: block-size 300ms ease, content-visibility 300ms allow-discrete;
  }
  .oe-est__faq-item[open]::details-content { block-size: auto; }
}
.oe-est__faq-a {
  padding: 0 4px 18px 32px;
  color: var(--oe-ink-muted);
  font-size: 14px;
  line-height: 1.65;
  max-width: 66ch;
}
.oe-est__faq-a p { margin: 0 0 10px; }
.oe-est__faq-a p:last-child { margin-bottom: 0; }
.oe-est__faq-a ul {
  margin: 0 0 10px;
  padding-left: 20px;
}
.oe-est__faq-a ul:last-child { margin-bottom: 0; }
.oe-est__faq-a li { margin: 0 0 4px; }
.oe-est__faq-a li:last-child { margin-bottom: 0; }
.oe-est__faq-item[id]:target {
  background: color-mix(in srgb, var(--oe-accent) 8%, transparent);
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 760px) {
  .oe-est { padding: 28px 16px 72px; }
  .oe-est__body { grid-template-columns: 1fr; }
  .oe-est__summary { position: static; }
  .oe-est__form { padding: 4px 18px; }
  .oe-est__field { grid-template-columns: 1fr; align-items: start; gap: 12px; }
  .oe-est__stepper, .oe-est__toggle { justify-self: start; }
  .oe-est__conn-grid { grid-template-columns: 1fr; }
}

/* --------------------------------------------------------------------------
   Reduced motion
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .oe-est__field--conditional { animation: none; }
  .oe-est__line--changed { animation: none; }
  .oe-est--nudge .oe-est__form > .oe-est__field:first-of-type,
  .oe-est--nudge .oe-est__form > .oe-est__field:first-of-type .oe-est__stepper { animation: none; }
  .oe-est__faq-item::details-content { transition: none; }
  .oe-est__cta-primary { transition: none; }
}