:root {
  --color-dark-blue: #001e50;
  --color-night-blue: #00437a;
  --color-lake-blue: #0082d6;
  --color-light-blue: #00b0f0;
  --color-sky-blue: #a9e3ff;
  --color-dark-grey: #3c484d;
  --color-medium-grey: #96a3a8;
  --color-tin-grey: #c2cacf;
  --color-page: #f4f6f7;
  --color-surface: #ffffff;
  --color-ink: #111827;
  --font-head: "VW Head", "Helvetica Neue", Arial, sans-serif;
  --font-text: "VW Text", "Helvetica Neue", Arial, sans-serif;
  --container: 1436px;
  color-scheme: light;
}

@font-face {
  font-display: swap;
  font-family: "VW Head";
  font-style: normal;
  font-weight: 300;
  src: url("./fonts/VWHead-Light.otf") format("opentype");
}

@font-face {
  font-display: swap;
  font-family: "VW Head";
  font-style: normal;
  font-weight: 400;
  src: url("./fonts/VWHead-Regular.otf") format("opentype");
}

@font-face {
  font-display: swap;
  font-family: "VW Head";
  font-style: normal;
  font-weight: 700;
  src: url("./fonts/VWHead-Bold.otf") format("opentype");
}

@font-face {
  font-display: swap;
  font-family: "VW Text";
  font-style: normal;
  font-weight: 300;
  src: url("./fonts/VWText-Light.otf") format("opentype");
}

* {
  box-sizing: border-box;
}

html {
  background: transparent;
}

body {
  background: transparent;
  color: var(--color-ink);
  font-family: var(--font-text);
  margin: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

.calculator {
  margin: 0 auto;
  max-width: var(--container);
  overflow: hidden;
  padding: 48px 0;
}

.calculator--stacked {
  display: grid;
  gap: 100px;
  overflow: visible;
}

.calculator-block {
  overflow: visible;
}

.calculator-block--charge {
  border-top: 1px solid var(--color-tin-grey);
  padding-top: 80px;
}

.calculator--stacked .hero {
  display: block;
}

.calculator--stacked .hero h2 {
  color: var(--color-dark-blue);
  font-family: var(--font-head);
  font-size: clamp(2.4rem, 4vw, 4.75rem);
  font-weight: 300;
  line-height: 1;
  margin: 0;
  text-transform: uppercase;
  word-break: break-word;
}

.calculator--stacked .hero__copy {
  margin-top: 20px;
}

.hero {
  align-items: start;
  display: grid;
  gap: 72px;
  grid-template-columns: minmax(320px, 0.82fr) minmax(320px, 1fr);
  margin-bottom: 44px;
}

.eyebrow {
  color: var(--color-lake-blue);
  font-family: var(--font-head);
  font-size: 0.875rem;
  font-weight: 700;
  margin: 0 0 12px;
}

h1 {
  color: var(--color-dark-blue);
  font-family: var(--font-head);
  font-size: clamp(2.4rem, 4vw, 4.75rem);
  font-weight: 300;
  line-height: 1.04;
  margin: 0;
  max-width: 780px;
  text-transform: uppercase;
  word-break: break-word;
}

.hero__copy {
  color: var(--color-dark-grey);
  font-size: clamp(1.2rem, 1.7vw, 1.58rem);
  font-weight: 300;
  line-height: 1.38;
  margin: 0;
  max-width: 760px;
}

.selectors {
  align-items: flex-start;
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
  margin-bottom: 28px;
  position: relative;
  z-index: 2;
}

.field {
  display: grid;
  gap: 12px;
  min-width: 260px;
}

.field--version {
  min-width: 420px;
}

.field span,
.panel h2 {
  color: var(--color-dark-blue);
  font-family: var(--font-head);
  font-size: 16px;
  font-weight: 700;
  line-height: 24px;
  margin: 0;
}

select {
  appearance: none;
  background: transparent
    linear-gradient(45deg, transparent 50%, var(--color-lake-blue) 50%) right 8px center / 8px 8px no-repeat;
  border: 0;
  border-bottom: 1px solid var(--color-medium-grey);
  color: var(--color-dark-blue);
  min-height: 48px;
  padding: 0 30px 0 0;
}

.tool-panel {
  display: none;
}

.tool-panel.is-active {
  display: block;
}

.workspace {
  display: grid;
  gap: 8px;
  width: 100%;
}

.workspace--charge {
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: repeat(2, auto);
}

.workspace--savings {
  grid-template-columns: minmax(360px, 0.95fr) minmax(0, 1.9fr);
}

.summary {
  background: var(--color-dark-blue);
  color: #fff;
  min-height: 560px;
  overflow: visible;
  padding: 32px 40px 48px;
  position: relative;
}

.summary::after {
  background: linear-gradient(135deg, rgba(0, 176, 240, 0.28), rgba(169, 227, 255, 0));
  content: "";
  inset: 0;
  pointer-events: none;
  position: absolute;
}

.summary--charge {
  grid-area: 1 / 1 / 3 / 2;
}

.summary__metric,
.summary__range {
  position: relative;
  text-align: center;
  z-index: 1;
}

.summary__metric p,
.summary__range p {
  color: #fff;
  font-family: var(--font-head);
  font-size: 16px;
  font-weight: 700;
  line-height: 24px;
  margin: 0 0 22px;
}

.summary__metric strong {
  display: block;
  font-family: var(--font-head);
  font-size: clamp(3.6rem, 6vw, 5.8rem);
  font-weight: 300;
  line-height: 1.08;
}

.summary__metric span {
  color: rgba(255, 255, 255, 0.78);
}

.summary__range {
  margin-top: 12px;
  padding: 70px 32px 116px;
}

.summary__range strong {
  display: block;
  font-family: var(--font-head);
  font-size: clamp(3rem, 5vw, 4.75rem);
  font-weight: 300;
  line-height: 1.05;
}

.summary__range small {
  color: rgba(255, 255, 255, 0.82);
  font-size: 32px;
  font-weight: 300;
  line-height: 40px;
}

.gauge {
  border: 2px solid rgba(0, 176, 240, 0.92);
  border-bottom: 0;
  border-radius: 320px 320px 0 0;
  height: 160px;
  left: 50%;
  position: absolute;
  top: 18px;
  transform: translateX(-50%);
  width: min(100%, 320px);
}

.summary__image {
  bottom: 0;
  filter: drop-shadow(0 20px 20px rgba(0, 0, 0, 0.32));
  left: 50%;
  max-width: 124%;
  position: absolute;
  transform: translateX(-50%);
  width: 560px;
  z-index: 1;
}

.summary--savings {
  min-height: 562px;
}

.summary--savings .summary__metric {
  text-align: left;
}

.summary--savings .summary__image {
  bottom: 38px;
}

.controls {
  display: contents;
}

.panel {
  background: var(--color-surface);
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-height: 248px;
  padding: 48px 40px;
}

.panel--wide {
  grid-area: 1 / 2 / 2 / 4;
}

.controls--charge .panel:nth-child(2) {
  grid-area: 2 / 2 / 3 / 3;
}

.controls--charge .panel:nth-child(3) {
  grid-area: 2 / 3 / 3 / 4;
}

.controls--savings {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.panel--prices {
  grid-column: 1 / -1;
}

.panel__title {
  align-items: flex-start;
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

.panel__copy {
  color: var(--color-dark-grey);
  line-height: 1.5;
  margin: 0;
}

.info {
  background: transparent;
  border: 1px solid var(--color-lake-blue);
  border-radius: 50%;
  color: var(--color-lake-blue);
  cursor: help;
  height: 20px;
  line-height: 18px;
  padding: 0;
  position: relative;
  width: 20px;
}

.info:focus::after,
.info:hover::after {
  background: var(--color-dark-blue);
  color: #fff;
  content: attr(data-tooltip);
  font-size: 12px;
  line-height: 1.35;
  max-width: 300px;
  padding: 10px 12px;
  position: absolute;
  right: 0;
  top: 28px;
  width: max-content;
  z-index: 4;
}

.segmented,
.power-options {
  display: grid;
  gap: 16px;
}

.segmented--chargers {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.power-options {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.option {
  align-items: center;
  background: transparent;
  border: 1px solid var(--color-night-blue);
  border-radius: 4px;
  color: var(--color-night-blue);
  cursor: pointer;
  display: inline-flex;
  gap: 8px;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  text-align: center;
  transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease, opacity 0.18s ease;
}

.option[aria-checked="true"] {
  background: var(--color-dark-blue);
  border-color: var(--color-dark-blue);
  color: #fff;
}

.option:not([disabled]):hover,
.button:hover,
.stepper:hover {
  background-color: #00437a;
  border-color: #00437a;
  color: #fff;
}

.option:not([disabled]):active,
.button:active,
.stepper:active {
  background-color: #0082d6;
  border-color: #0082d6;
  color: #fff;
}

.option[aria-disabled="true"] {
  border-color: var(--color-tin-grey);
  color: var(--color-medium-grey);
  cursor: not-allowed;
  opacity: 1;
}

.option__icon {
  background-color: currentColor;
  height: 30px;
  mask-position: center;
  mask-repeat: no-repeat;
  mask-size: contain;
  -webkit-mask-position: center;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-size: contain;
  width: 30px;
}

.option__icon--domestic-plug {
  mask-image: url("./ico-enchufe-domestico.svg");
  -webkit-mask-image: url("./ico-enchufe-domestico.svg");
}

.option__icon--home-charger {
  mask-image: url("./ico-cargador-domestico.svg");
  -webkit-mask-image: url("./ico-cargador-domestico.svg");
}

.option__icon--public {
  mask-image: url("./ico-estacion-de-carga.svg");
  -webkit-mask-image: url("./ico-estacion-de-carga.svg");
}

.range-labels {
  font-weight: 600;
  height: 22px;
  position: relative;
}

.range-labels output,
.range-output {
  color: var(--color-dark-grey);
  font-size: 13px;
  font-weight: 700;
  position: absolute;
  transform: translateX(-50%);
  white-space: nowrap;
}

#currentSocOutput {
  left: var(--current-pos, calc(10% + 0px));
}

#targetSocOutput {
  left: var(--target-pos, calc(80% + 0px));
}

[data-field="currentSocOutput"] {
  left: var(--current-pos, calc(10% + 0px));
}

[data-field="targetSocOutput"] {
  left: var(--target-pos, calc(80% + 0px));
}

.dual-slider,
.temperature-slider {
  --thumb-size: 22px;
  --thumb-half: 11px;
  position: relative;
}

.dual-slider {
  display: grid;
  min-height: 64px;
}

.dual-slider::before {
  background: var(--color-tin-grey);
  content: "";
  height: 4px;
  left: 0;
  position: absolute;
  right: 0;
  top: 15px;
}

.dual-slider input {
  grid-area: 1 / 1;
  pointer-events: none;
  z-index: 3;
}

.dual-slider input::-webkit-slider-thumb {
  pointer-events: auto;
}

.dual-slider input::-moz-range-thumb {
  pointer-events: auto;
}

.dual-slider__track {
  background: var(--color-lake-blue);
  height: 4px;
  left: var(--current-pos, calc(10% + 0px));
  pointer-events: none;
  position: absolute;
  top: 15px;
  width: calc(var(--target-pos, calc(80% + 0px)) - var(--current-pos, calc(10% + 0px)));
  z-index: 2;
}

.recommended-marker {
  color: var(--color-dark-grey);
  font-size: 12px;
  left: var(--recommended-pos, calc(80% + 0px));
  line-height: 16px;
  padding-top: 28px;
  pointer-events: none;
  position: absolute;
  top: 17px;
  transform: translateX(-50%);
  white-space: nowrap;
  z-index: 1;
}

.recommended-marker::before {
  background: var(--color-dark-grey);
  content: "";
  height: 24px;
  left: 50%;
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  width: 1px;
}

input[type="range"] {
  appearance: none;
  background: transparent;
  height: 34px;
  margin: 0;
  width: 100%;
}

input[type="range"]::-webkit-slider-runnable-track {
  background: var(--color-tin-grey);
  height: 4px;
}

input[type="range"]::-moz-range-track {
  background: var(--color-tin-grey);
  height: 4px;
}

.dual-slider input::-webkit-slider-runnable-track {
  background: transparent;
}

.dual-slider input::-moz-range-track {
  background: transparent;
}

input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  background: var(--color-dark-blue);
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  height: 22px;
  margin-top: -9px;
  width: 22px;
}

input[type="range"]::-moz-range-thumb {
  background: var(--color-dark-blue);
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  height: 22px;
  width: 22px;
}

.temperature-slider {
  margin-top: 36px;
}

.range-output {
  left: var(--temperature-pos, 60%);
  top: -24px;
}

.range-scale {
  color: var(--color-dark-grey);
  display: flex;
  font-size: 13px;
  justify-content: space-between;
}

.numeric-field {
  align-items: baseline;
  display: flex;
  gap: 12px;
}

.numeric-field input {
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--color-medium-grey);
  color: var(--color-dark-blue);
  font-family: var(--font-head);
  font-size: 56px;
  font-weight: 300;
  min-width: 0;
  width: 160px;
}

.numeric-field span,
.distance-value span {
  color: var(--color-dark-grey);
  font-size: 22px;
}

.distance-value {
  color: var(--color-dark-blue);
  font-family: var(--font-head);
  font-size: 64px;
  font-weight: 300;
  line-height: 1;
}

.price-control {
  align-items: center;
  display: grid;
  gap: 18px;
  grid-template-columns: 46px minmax(0, 1fr) 46px;
}

.price-control label {
  display: grid;
  gap: 6px;
}

.price-control label span {
  color: var(--color-dark-blue);
  font-family: var(--font-head);
  font-weight: 700;
}

.price-label {
  align-items: center;
  display: inline-flex;
  gap: 10px;
}

.price-label img {
  flex: 0 0 auto;
  height: 28px;
  object-fit: contain;
  width: 28px;
}

.price-control input {
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--color-medium-grey);
  color: var(--color-dark-blue);
  min-height: 44px;
}

.price-control a {
  color: var(--color-lake-blue);
  font-size: 13px;
  font-weight: 700;
}

.stepper {
  background: var(--color-dark-blue);
  border: 0;
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  height: 46px;
  width: 46px;
}

.button {
  align-items: center;
  background: var(--color-dark-blue);
  border: 1px solid var(--color-dark-blue);
  border-radius: 4px;
  color: #fff;
  display: inline-flex;
  font-family: var(--font-head);
  font-weight: 700;
  justify-content: center;
  min-height: 46px;
  padding: 0 28px;
  text-align: center;
}

.button--ghost {
  background: transparent;
  color: var(--color-dark-blue);
}

.vehicle-detail {
  align-items: center;
  background: #fff;
  display: flex;
  gap: 28px;
  justify-content: space-between;
  margin-top: 8px;
  padding: 32px 40px;
}

.vehicle-detail h2 {
  color: var(--color-dark-blue);
  font-family: var(--font-head);
  font-size: 32px;
  font-weight: 300;
  line-height: 40px;
  margin: 0 0 12px;
}

.vehicle-detail p:last-child {
  color: var(--color-dark-grey);
  line-height: 1.5;
  margin: 0;
  max-width: 860px;
}

.vehicle-detail__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.disclaimer {
  color: var(--color-dark-grey);
  font-size: 12px;
  line-height: 16px;
  margin: 64px 0 0;
}

@media (max-width: 1500px) {
  .calculator {
    padding-left: 64px;
    padding-right: 64px;
  }
}

@media (max-width: 1015px) {
  .calculator {
    padding-top: 48px;
  }

  .hero,
  .workspace--savings {
    grid-template-columns: 1fr;
  }

  .workspace--charge {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: repeat(3, auto);
  }

  .summary--charge {
    grid-area: 1 / 1 / 2 / 3;
    min-height: 380px;
    padding: 32px 24px;
  }

  .summary--charge .summary__metric {
    margin-left: 48%;
  }

  .summary--charge .summary__range {
    margin: 0;
    padding: 74px 0 0;
    position: absolute;
    top: 60px;
    width: 48%;
  }

  .summary--charge .summary__image {
    bottom: 1px;
    left: 58%;
    width: 48%;
  }

  .panel--wide {
    grid-area: 2 / 1 / 3 / 3;
  }

  .controls--charge .panel:nth-child(2) {
    grid-area: 3 / 1 / 4 / 2;
  }

  .controls--charge .panel:nth-child(3) {
    grid-area: 3 / 2 / 4 / 3;
  }
}

@media (max-width: 763px) {
  .calculator {
    padding: 40px 16px 48px;
  }

  .hero {
    display: block;
    margin-bottom: 30px;
  }

  .hero__copy {
    font-size: 18px;
    line-height: 24px;
    margin-top: 22px;
  }

  .selectors,
  .vehicle-detail,
  .controls--savings {
    display: grid;
    grid-template-columns: 1fr;
  }

  .field,
  .field--version {
    min-width: 100%;
  }

  .workspace {
    grid-template-columns: 1fr;
    margin-left: -16px;
    width: calc(100% + 32px);
  }

  .summary--charge,
  .summary--savings {
    grid-area: auto;
    min-height: 520px;
    padding: 32px 24px 118px;
  }

  .summary--charge .summary__metric {
    margin-left: 0;
  }

  .summary__metric strong {
    font-size: 56px;
  }

  .summary--charge .summary__range {
    margin-top: 22px;
    padding: 74px 0 120px;
    position: relative;
    top: auto;
    width: 100%;
  }

  .summary__range strong {
    font-size: 48px;
  }

  .summary--charge .summary__image,
  .summary__image {
    bottom: 1px;
    left: 50%;
    max-width: 126%;
    width: 430px;
  }

  .calculator--stacked .summary__image {
    max-width: 116%;
    width: 390px;
  }

  .panel,
  .panel--wide,
  .controls--charge .panel:nth-child(2),
  .controls--charge .panel:nth-child(3),
  .panel--prices {
    grid-area: auto;
    grid-column: auto;
  }

  .panel {
    min-height: auto;
    padding: 24px;
  }

  .segmented--chargers {
    grid-template-columns: 1fr;
  }

  .power-options {
    display: flex;
    flex-wrap: wrap;
  }

  .option {
    min-width: 78px;
  }

  .vehicle-detail {
    margin-left: -16px;
    width: calc(100% + 32px);
  }

  .price-control {
    grid-template-columns: 40px minmax(0, 1fr) 40px;
  }
}
