/* Campaign calculator (/campagne-calculator/). Ported from the first rebuild; the
   design tokens it relies on that this site does not define globally are set
   on the calculator section itself, so nothing outside the page is affected. */

.calculator {
  --color-border: rgba(0, 5, 22, 0.1);
  --color-gray: #888888;
  --h2-leading: 1.12em;
  --h2-size: 44px;
  --h2-tracking: -0.9px;
  --h2-weight: 900;
  --h3-size: 28px;
  --h4-size: 22px;
  --h4-weight: 700;
  --leading-ui: 1.4em;
  --radius: 12px;
  --radius-lg: 24px;
  --radius-pill: 999px;
  --radius-sm: 8px;
  --shadow-lg: 0 18px 48px rgba(0, 5, 22, 0.14);
  --shadow-md: 0 4px 16px rgba(0, 5, 22, 0.08);
  --shadow-sm: 0 1px 2px rgba(0, 5, 22, 0.06);
  --text-md: 16px;
  --text-sm: 13px;
  --transition: 0.25s ease;
  --calc-positive: #1e7d43;              /* profit */
  --calc-negative: #c0392b;              /* loss */
  --calc-on-dark-muted: rgba(255, 255, 255, 0.75);
  --calc-on-dark-soft: rgba(255, 255, 255, 0.82);
}

/* Campagne calculator, styled with the site's design tokens so the tool
   reads as a native page, not an embedded widget. */

.calculator {
  /* Anchor for the step-change scroll; clears the fixed header. */
  scroll-margin-top: calc(var(--header-height) + 12px);
}

.calculator .section__inner {
  max-width: 880px;
  margin-inline: auto;
}

/* ---- Progress ----------------------------------------------------------- */

.calc-progress {
  display: flex;
  gap: 4px;
  margin-bottom: 40px;
  padding: 14px 8px;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.progress-step {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: default;
  font-family: var(--font-ui);
  color: var(--color-gray);
}

.progress-step .dot {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid currentColor;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  background: var(--color-white);
  transition: background var(--transition), color var(--transition);
}

.progress-step .p-label {
  font-size: var(--text-sm);
  font-weight: 600;
}

.progress-step.active { color: var(--color-primary); }
.progress-step.active .dot {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: var(--color-white);
}

.progress-step.done { color: var(--color-primary); cursor: pointer; }
.progress-step.done .dot {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: var(--color-white);
}

/* ---- Step furniture ----------------------------------------------------- */

.step-title {
  font-size: var(--h2-size);
  font-weight: var(--h2-weight);
  letter-spacing: var(--h2-tracking);
  line-height: var(--h2-leading);
  color: var(--color-primary);
  margin-bottom: 12px;
}

.step-intro {
  font-family: var(--font-ui);
  color: var(--color-gray);
  line-height: var(--leading-ui);
  margin-bottom: 28px;
  max-width: 620px;
}

.sub-title {
  font-size: var(--h4-size);
  font-weight: var(--h4-weight);
  color: var(--color-primary);
  margin: 40px 0 10px;
}

.step-hint {
  font-family: var(--font-ui);
  font-weight: 600;
  color: var(--calc-negative);
  margin-top: 14px;
}

@keyframes stepIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
.step:not([hidden]) { animation: stepIn 0.3s ease both; }

/* ---- Step 1: trade grid ------------------------------------------------- */

.trade-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
@media (min-width: 640px) { .trade-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 860px) { .trade-grid { grid-template-columns: repeat(4, 1fr); } }

.trade-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 22px 12px;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 600;
  color: var(--color-primary);
  text-align: center;
  transition: transform var(--transition), box-shadow var(--transition),
    border-color var(--transition);
}

.trade-card .t-icon { font-size: 32px; line-height: 1; }

.trade-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--color-accent);
}

.trade-card.selected {
  border: 2px solid var(--color-accent);
  box-shadow: var(--shadow-md);
}

/* ---- Step 2: services --------------------------------------------------- */

.service-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.service-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 15px 18px;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  font-family: var(--font-ui);
  font-size: var(--text-md);
  transition: border-color var(--transition);
}

.service-item:hover { border-color: var(--color-accent); }
.service-item input { display: none; }

.service-item .check {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  border: 2px solid var(--color-border);
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
  background: var(--color-white);
  color: transparent;
  transition: background var(--transition), border-color var(--transition);
}

.service-item.checked { border-color: var(--color-accent); }
.service-item.checked .check {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: var(--color-white);
}

.service-item .custom-tag {
  margin-left: auto;
  font-size: 13px;
  color: var(--color-gray);
  font-weight: 600;
}

.add-service { display: flex; gap: 10px; margin-top: 20px; }

.add-service input {
  flex: 1;
  padding: 12px 16px;
  font-family: var(--font-ui);
  font-size: var(--text-md);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-white);
}

.add-service input:focus {
  outline: 2px solid var(--color-accent);
  outline-offset: 1px;
}

/* ---- Calculation cards (steps 3 & 4) ------------------------------------ */

.profit-cards, .lead-cards { display: flex; flex-direction: column; gap: 18px; }

.calc-card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 24px;
}

.calc-card h4 {
  font-size: 18px;
  font-weight: var(--h4-weight);
  color: var(--color-primary);
  margin-bottom: 18px;
}

.field-label {
  display: block;
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 14px;
  color: var(--color-primary);
  margin-bottom: 8px;
}

.field-help {
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--color-gray);
  margin-top: 6px;
}

.field-row, .lead-card-fields {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}
@media (min-width: 640px) {
  .field-row, .lead-card-fields { grid-template-columns: 1fr 1fr; }
}

/* Stepper: value with +/- buttons */
.stepper { display: flex; align-items: stretch; }

.stepper button {
  width: 46px;
  font-size: 20px;
  font-weight: 600;
  cursor: pointer;
  background: var(--color-primary);
  color: var(--color-white);
  border: 1px solid var(--color-primary);
  transition: background var(--transition);
}
.stepper button:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.stepper button:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.stepper button:hover { background: var(--color-accent); border-color: var(--color-accent); }

.stepper input {
  flex: 1;
  min-width: 0;
  text-align: center;
  font-family: var(--font-ui);
  font-size: 17px;
  font-weight: 600;
  color: var(--color-primary);
  padding: 11px 4px;
  border: 1px solid var(--color-border);
  border-left: none;
  border-right: none;
  background: var(--color-white);
}
.stepper input:focus { outline: 2px solid var(--color-accent); outline-offset: -2px; }

/* Sliders */
.calculator input[type="range"] {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  height: 8px;
  border-radius: var(--radius-pill);
  margin: 14px 0 6px;
  background: linear-gradient(to right,
    var(--color-accent) 0%, var(--color-accent) var(--fill, 50%),
    var(--color-border) var(--fill, 50%), var(--color-border) 100%);
  cursor: pointer;
}

.calculator input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--color-accent);
  border: 3px solid var(--color-white);
  box-shadow: var(--shadow-md);
  cursor: grab;
}

.calculator input[type="range"]::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--color-accent);
  border: 3px solid var(--color-white);
  box-shadow: var(--shadow-md);
  cursor: grab;
}

.range-ends {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--color-gray);
}

/* Live result strip on profit cards */
.card-result {
  margin-top: 20px;
  padding: 14px 18px;
  background: var(--color-primary);
  border-radius: var(--radius-sm);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.card-result .label {
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 600;
  color: var(--calc-on-dark-muted);
}

.card-result .amount {
  font-size: 22px;
  font-weight: 800;
  color: var(--color-accent);
}

/* ---- Step 4: budget ----------------------------------------------------- */

.budget-card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 28px;
  margin-bottom: 8px;
}

.big-value {
  font-size: 40px;
  font-weight: 800;
  color: var(--color-accent);
  margin: 4px 0;
}

/* ---- Step 5: results ---------------------------------------------------- */

.winner-card {
  background: var(--color-primary);
  color: var(--color-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 32px;
  margin-bottom: 16px;
}

.winner-card .w-kicker {
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-accent);
}

.winner-card h3 {
  font-size: var(--h3-size);
  font-weight: 800;
  color: var(--color-white);
  margin: 8px 0 12px;
}

.winner-card p {
  font-family: var(--font-ui);
  line-height: var(--leading-ui);
  color: var(--calc-on-dark-soft);
  max-width: 560px;
}

.winner-card strong { color: var(--color-white); }

.result-card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 20px 24px;
  margin-bottom: 14px;
}

.result-card.rank-1 { border: 2px solid var(--color-accent); }

.result-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.rank-badge {
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  background: var(--color-primary);
  color: var(--color-white);
  padding: 3px 12px;
  border-radius: var(--radius-pill);
}

.rank-1 .rank-badge { background: var(--color-accent); }

.result-head h4 {
  font-size: 17px;
  font-weight: var(--h4-weight);
  color: var(--color-primary);
  flex: 1;
}

.result-profit { font-size: 19px; font-weight: 800; }
.result-profit.pos { color: var(--calc-positive); }
.result-profit.neg { color: var(--calc-negative); }

.result-flow {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--color-border);
}
@media (min-width: 640px) { .result-flow { grid-template-columns: repeat(4, 1fr); } }

.flow-item .f-label {
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  color: var(--color-gray);
}

.flow-item .f-value {
  font-size: 17px;
  font-weight: 700;
  color: var(--color-primary);
}

.result-note {
  margin-top: 14px;
  font-family: var(--font-ui);
  font-size: 14px;
  color: var(--color-gray);
}
.result-note strong { color: var(--color-primary); }

.result-warning {
  margin-top: 12px;
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 600;
  color: var(--calc-negative);
}

/* ---- Help box & CTA ----------------------------------------------------- */

.help-box {
  margin-top: 24px;
  background: var(--color-white);
  border: 1px dashed var(--color-accent);
  border-radius: var(--radius);
  padding: 16px 20px;
}

.help-box summary {
  font-family: var(--font-ui);
  font-weight: 600;
  cursor: pointer;
  font-size: 15px;
  color: var(--color-primary);
}

.help-box ul {
  margin: 12px 0 4px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: var(--leading-ui);
  list-style: disc;
}

.cta-block {
  margin-top: 48px;
  padding: 36px;
  background: var(--color-primary);
  color: var(--color-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.cta-block h3 {
  font-size: var(--h3-size);
  font-weight: 800;
  color: var(--color-white);
  margin-bottom: 12px;
}

.cta-block p {
  font-family: var(--font-ui);
  line-height: var(--leading-ui);
  color: var(--calc-on-dark-soft);
  max-width: 520px;
  margin-bottom: 24px;
}

.disclaimer {
  margin-top: 24px;
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--color-gray);
}

/* ---- Wizard nav --------------------------------------------------------- */

.step-nav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 40px;
  padding-top: 26px;
  border-top: 1px solid var(--color-border);
}

.step-nav .knop { flex: 1; max-width: 240px; }
/* .knop sets display:inline-flex, which would override the hidden attribute. */
.step-nav[hidden], .step-nav .knop[hidden] { display: none; }

@media (max-width: 480px) {
  .step-nav .knop { max-width: none; }
}
