/* Besparingscalculator: page-calculator.php */

.besparing {
  --kg-oranje: #e94e1b;
  --kg-oranje-licht: rgba(233, 78, 27, 0.06);
  --kg-donker: #252525;
  --kg-grijs: #6b6b6b;
  --kg-rand: #d6d6d6;
}

.besparing [hidden] {
  display: none !important;
}

/* Intro */
.besparing-intro {
  min-height: 0;
  padding-top: 40px;
  padding-bottom: 40px;
}
.besparing-intro__inhoud {
  position: relative;
  display: flex;
  align-items: center;
  gap: 20px;
}
/* Speels: half buiten het oranje vlak */
.besparing-intro__icoon {
  position: relative;
  z-index: 2;
  flex: 0 0 auto;
  width: 70px;
  height: auto;
  align-self: flex-end;
  margin-bottom: -60px;
  filter: drop-shadow(0 10px 14px rgba(0, 0, 0, 0.25));
}
@media (min-width: 768px) {
  .besparing-intro__icoon {
    width: 100px;
  }
}
/* Desktop: naast de kolom, in de vrije ruimte rechts, over de onderrand */
@media (min-width: 992px) {
  .besparing-intro__icoon {
    position: absolute;
    left: calc(100% + 40px);
    bottom: -80px;
    width: 140px;
    margin: 0;
  }
}
.besparing-intro h1 {
  margin-bottom: 10px;
}
.besparing-intro p {
  margin-bottom: 0;
  max-width: 640px;
}

/* Alles in één gecentreerde kolom: eerst de rekentool, daarna de uitkomst */
.besparing-intro .row,
.besparing > .container > .row {
  justify-content: center;
}

/* Vragen */
.besparing-vragen {
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 12px 32px rgba(0, 0, 0, 0.08);
}
.besparing-vragen,
.besparing-uitkomst {
  border-radius: 12px;
}
@media (min-width: 992px) {
  .besparing-vragen {
    padding: 35px;
  }
}

.besparing-vraag {
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
}
.besparing-vraag:focus {
  outline: none;
}

/* Stappen */
.besparing-voortgang {
  font-size: 0.8em;
  color: var(--kg-grijs);
  margin-bottom: 20px;
}
.besparing-voortgang__balk {
  height: 6px;
  margin-top: 6px;
  border-radius: 3px;
  background: #eee;
  overflow: hidden;
}
.besparing-voortgang__balk span {
  display: block;
  height: 100%;
  width: 25%;
  background: var(--kg-oranje);
  transition: width 0.25s;
}
.besparing-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: 25px;
}
.besparing-nav [data-volgende] {
  margin-left: auto;
}
.besparing-vragen .besparing-fout {
  margin: 0;
}
.besparing-vraag legend {
  float: none;
  width: 100%;
  font-size: 1.05em;
  font-weight: 700;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.besparing-vraag .nr {
  flex: 0 0 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--kg-oranje);
  color: #fff;
  font-size: 0.8em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.besparing-vraag .optioneel {
  font-weight: 400;
  color: var(--kg-grijs);
}

.besparing-hint {
  font-size: 0.8em;
  color: var(--kg-grijs);
  margin: 8px 0 0;
}

/* Keuzetegels */
.besparing-keuzes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
@media (min-width: 768px) {
  .besparing-keuzes--3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .besparing-keuzes--4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.besparing-keuze {
  position: relative;
  cursor: pointer;
  margin: 0;
}
.besparing-keuze input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.besparing-keuze__tegel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 100%;
  min-height: 64px;
  padding: 12px;
  border: 2px solid var(--kg-rand);
  border-radius: 4px;
  text-align: center;
  line-height: 1.25;
  transition: border-color 0.15s, background-color 0.15s;
}
.besparing-keuze__tegel strong {
  font-size: 0.9em;
}
.besparing-keuze__tegel small {
  font-size: 0.7em;
  color: var(--kg-grijs);
  margin-top: 4px;
}
.besparing-keuze__icoon {
  display: block;
  width: 64px;
  height: 40px;
  margin: 0 auto 8px;
  color: var(--kg-donker);
  transition: color 0.15s;
}
.besparing-keuze input:checked + .besparing-keuze__tegel .besparing-keuze__icoon {
  color: var(--kg-oranje);
}
.besparing-keuze:hover .besparing-keuze__tegel {
  border-color: #aaa;
}
.besparing-keuze input:checked + .besparing-keuze__tegel {
  border-color: var(--kg-oranje);
  background: var(--kg-oranje-licht);
}
.besparing-keuze input:focus-visible + .besparing-keuze__tegel {
  outline: 3px solid rgba(233, 78, 27, 0.35);
  outline-offset: 2px;
}

/* Stepper */
.besparing-stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--kg-rand);
  border-radius: 4px;
  background: #fff;
  height: 56px;
}
.besparing-stepper input {
  width: 90px;
  height: 100%;
  border: 0;
  text-align: center;
  font-size: 1.1em;
  font-weight: 700;
  background: transparent;
  -moz-appearance: textfield;
}
.besparing-stepper input::-webkit-outer-spin-button,
.besparing-stepper input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.besparing-stepper input:focus {
  outline: none;
}
.besparing-stepper:focus-within {
  border-color: var(--kg-oranje);
}
.besparing-stepper--vrij input {
  width: 140px;
  text-align: left;
  padding-left: 15px;
}
.besparing-stepper__eenheid {
  color: var(--kg-grijs);
  padding: 0 8px;
}
.besparing-stepper__btn {
  width: 52px;
  height: 100%;
  border: 0;
  background: #f1f1f1;
  font-size: 1.3em;
  color: var(--kg-donker);
  cursor: pointer;
}
.besparing-stepper__btn:first-child {
  border-radius: 3px 0 0 3px;
}
.besparing-stepper__btn:last-child {
  border-radius: 0 3px 3px 0;
}
.besparing-stepper__btn:hover {
  background: #e6e6e6;
}

.besparing-stepper--klein {
  height: 44px;
}
.besparing-stepper--klein input {
  width: 50px;
  font-size: 1em;
}
.besparing-stepper--klein .besparing-stepper__btn {
  width: 40px;
}

/* Help mij inschatten */
.besparing-hulp-link {
  display: block;
  width: fit-content;
  margin-top: 10px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--kg-oranje);
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
}
.besparing-hulp {
  width: min(560px, calc(100% - 32px));
  max-height: calc(100% - 32px);
  padding: 30px 25px 25px;
  border: 0;
  border-radius: 4px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
}
.besparing-hulp::backdrop {
  background: rgba(0, 0, 0, 0.5);
}
.besparing-hulp h3 {
  font-size: 1.2em;
  margin-bottom: 5px;
}
.besparing-hulp p {
  font-size: 0.85em;
  color: var(--kg-grijs);
}
.besparing-hulp__sluit {
  position: absolute;
  top: 10px;
  right: 12px;
  border: 0;
  background: none;
  font-size: 1.8em;
  line-height: 1;
  color: var(--kg-grijs);
  cursor: pointer;
}
.besparing-hulp__rij {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 10px 0;
  border-bottom: 1px solid #eee;
}
.besparing-hulp__rij label {
  margin: 0;
  line-height: 1.25;
}
.besparing-hulp__rij strong {
  display: block;
  font-size: 0.9em;
}
.besparing-hulp__rij small {
  font-size: 0.75em;
  color: var(--kg-grijs);
}
.besparing-hulp__rij .besparing-stepper {
  flex: 0 0 auto;
}
.besparing-hulp p.besparing-hulp__totaal {
  margin: 15px 0;
  font-size: 1em;
  color: var(--kg-donker);
}
.besparing-hulp__totaal strong {
  color: var(--kg-oranje);
}
.besparing-hulp .btn {
  width: 100%;
  height: auto;
}
.besparing-hulp [data-hulp-gemiddeld] {
  display: block;
  margin: 15px auto 0;
  font-size: 0.85em;
  font-weight: 400;
  text-align: center;
}

/* Uitkomst */
.besparing-uitkomst {
  scroll-margin-top: 100px; /* niet onder de vaste header scrollen */
  background: var(--kg-donker);
  color: #fff;
  padding: 25px;
  text-align: center;
}
@media (min-width: 992px) {
  .besparing-uitkomst {
    position: sticky;
    top: 20px;
    padding: 35px;
  }
}
.besparing-uitkomst h2 {
  font-size: 1em;
  font-weight: 400;
  color: #ddd;
  margin: 0 0 5px;
}
.besparing-uitkomst__bedrag {
  font-size: 3.2em;
  font-weight: 800;
  line-height: 1.1;
  color: var(--kg-oranje);
}
.besparing-uitkomst__per {
  margin: 0 0 20px;
}
.besparing-uitkomst__cijfers {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  overflow: hidden;
  margin: 0 0 15px;
}
.besparing-uitkomst__cijfers > div {
  background: var(--kg-donker);
  padding: 12px 8px;
  display: flex;
  flex-direction: column-reverse;
}
.besparing-uitkomst__cijfers dt {
  font-weight: 400;
  font-size: 0.75em;
  color: #bbb;
}
.besparing-uitkomst__cijfers dd {
  margin: 0;
  font-size: 1.25em;
  font-weight: 700;
}
.besparing-uitkomst__warmte,
.besparing-uitkomst__check {
  font-size: 0.75em;
  color: #ccc;
  text-align: left;
}
.besparing-uitkomst__warmte {
  font-size: 0.85em;
  color: #fff;
  text-align: center;
}
.besparing-uitkomst__check {
  color: #ffd27a;
  text-align: center;
}
.besparing-uitkomst .btn {
  margin-top: 5px;
  white-space: normal;
}
.besparing-uitkomst .btn + .btn {
  margin-top: 10px;
}
.besparing-uitkomst__aanpassen {
  margin: 15px auto 0;
  color: #ccc;
  font-weight: 400;
  font-size: 0.85em;
}

.besparing-fout {
  color: #dc3545;
  font-size: 0.85em;
  margin: 15px 0 0;
}

/* Uitleg */
.besparing-uitleg {
  font-size: 0.85em;
  color: var(--kg-grijs);
  margin-top: 15px;
}
.besparing-uitleg h3 {
  font-size: 1.1em;
  color: var(--kg-donker);
}

/* Mobiele balk */
.besparing-balk {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 16px;
  background: var(--kg-donker);
  color: #fff;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
}
.besparing-balk strong {
  color: var(--kg-oranje);
  font-size: 1.3em;
  margin: 0 4px;
}
.besparing-balk small {
  color: #ccc;
}
@media (min-width: 992px) {
  .besparing-balk {
    display: none !important;
  }
}
