:root {
  --color-bg: #f4f4f3;
  --color-bg-block: #fff;
  --color-bg-summary: #1a1a1a;
  --color-font-title: #242424;
  --color-font-text: #737373;
  --color-font-summary: #f4f4f3;
  --color-border: #222;
  --color-border-soft: #d9d9d9;
  --font-base: "CupraScreen", "Helvetica Neue", Arial, sans-serif;
  --container: 1436px;
  color-scheme: light;
}

@font-face {
  font-display: swap;
  font-family: "CupraScreen";
  font-style: normal;
  font-weight: 300;
  src: url("./fonts/CupraScreen-Light.woff2") format("woff2"),
    url("./fonts/Cupra-Light.otf") format("opentype");
}

@font-face {
  font-display: swap;
  font-family: "CupraScreen";
  font-style: normal;
  font-weight: 350;
  src: url("./fonts/CupraScreen-Book.woff2") format("woff2"),
    url("./fonts/Cupra-Book.otf") format("opentype");
}

@font-face {
  font-display: swap;
  font-family: "CupraScreen";
  font-style: normal;
  font-weight: 400;
  src: url("./fonts/CupraScreen-Regular.woff2") format("woff2"),
    url("./fonts/Cupra-Regular.otf") format("opentype");
}

@font-face {
  font-display: swap;
  font-family: "CupraScreen";
  font-style: normal;
  font-weight: 700;
  src: url("./fonts/CupraScreen-Medium.woff2") format("woff2"),
    url("./fonts/Cupra-Medium.otf") format("opentype");
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-font-title);
  font-family: var(--font-base);
}

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

button,
input,
select {
  font: inherit;
}

.button {
  align-items: center;
  background: #1a1a1a;
  border: 1px solid #1a1a1a;
  color: #fff;
  display: inline-flex;
  font-weight: 500;
  justify-content: center;
  min-height: 46px;
  padding: 0 28px;
}

.button--ghost {
  background: transparent;
  color: #1a1a1a;
}

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

.hero {
  margin-bottom: 64px;
  padding: 0 0;
}

.eyebrow {
  color: var(--color-font-text);
  font-size: 0.875rem;
  letter-spacing: 0.04em;
  margin: 0 0 12px;
  text-transform: none;
}

h1 {
  color: var(--color-font-title);
  font-size: 48px;
  font-weight: 350;
  letter-spacing: 0.06em;
  line-height: 56px;
  margin: 0;
  text-transform: uppercase;
  word-break: break-word;
}

.hero__copy {
  color: var(--color-font-text);
  font-size: 24px;
  font-weight: 350;
  line-height: 32px;
  margin: 28px 0 0;
  max-width: 1280px;
}

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

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

.field:nth-child(2) {
  min-width: 468px;
}

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

select {
  appearance: none;
  background: transparent
    linear-gradient(45deg, transparent 50%, #777 50%) right 8px center / 8px 8px no-repeat;
  border: 0;
  border-bottom: 1px solid #8c8c8c;
  color: var(--color-font-title);
  min-height: 48px;
  padding: 0 30px 0 0;
}

.workspace {
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: repeat(2, auto);
  width: 100%;
}

.summary {
  background: var(--color-bg-summary);
  color: var(--color-font-summary);
  grid-area: 1 / 1 / 3 / 2;
  min-height: 560px;
  overflow: hidden;
  padding: 32px 32px 48px;
  position: relative;
}

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

.summary__time {
  padding-bottom: 12px;
}

.summary__time p,
.summary__range p {
  color: var(--color-font-summary);
  font-size: 16px;
  font-weight: 700;
  line-height: 24px;
  margin: 0 0 22px;
}

.summary__time strong {
  display: block;
  font-size: 96px;
  font-weight: 300;
  letter-spacing: 0.02em;
  line-height: 104px;
}

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

.summary__range strong {
  display: block;
  font-size: 76px;
  font-weight: 300;
  line-height: 80px;
}

.summary__range small {
  color: #dfdfdf;
  font-size: 32px;
  font-weight: 300;
  line-height: 40px;
}

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

.summary__image {
  bottom: 10px;
  filter: drop-shadow(0 18px 18px rgba(0, 0, 0, 0.32));
  left: 50%;
  max-width: 112%;
  position: absolute;
  transform: translateX(-50%);
  width: 540px;
}

.controls {
  display: contents;
}

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

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

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

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

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

.info {
  background: transparent;
  border: 1px solid #6b6b6b;
  border-radius: 50%;
  color: #6b6b6b;
  cursor: help;
  height: 18px;
  line-height: 16px;
  padding: 0;
  position: relative;
  width: 18px;
}

.info:focus::after,
.info:hover::after {
  background: #1a1a1a;
  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 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

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

.option {
  align-items: center;
  background: #fff;
  border: 1px solid #1f1f1f;
  border-radius: 999px;
  color: #2a2a2a;
  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, opacity 0.18s ease;
}

.option[aria-checked="true"] {
  background: #1a1a1a;
  color: #fff;
}

.option[aria-disabled="true"] {
  border-color: #cfcfcf;
  color: #b9b9b9;
  cursor: not-allowed;
  opacity: 1;
}

.option__icon {
  background-color: currentColor;
  height: 30px;
  mask-position: center;
  mask-repeat: no-repeat;
  mask-size: contain;
/*   opacity: 0.72; */
  -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: #303030;
  font-size: 13px;
  font-weight: 500;
  position: absolute;
  transform: translateX(-50%);
  white-space: nowrap;
}

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

#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: #d5d5d5;
  content: "";
  height: 4px;
  left: 0;
  position: absolute;
  right: 0;
  top: 15px;
}

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

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

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

.dual-slider__track {
  background: #1a1a1a;
  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: #666;
  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: #666;
  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: #d5d5d5;
  height: 4px;
}

input[type="range"]::-moz-range-track {
  background: #d5d5d5;
  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: #1a1a1a;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  height: 22px;
  margin-top: -9px;
  width: 22px;
}

input[type="range"]::-moz-range-thumb {
  background: #1a1a1a;
  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;
}

.single-slider {
  display: block;
}

.range-scale {
  color: #7d7d7d;
  display: flex;
  font-size: 13px;
  justify-content: space-between;
}

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

.vehicle-detail h2 {
  font-size: 32px;
  font-weight: 350;
  line-height: 40px;
  margin: 0 0 12px;
}

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

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

.disclaimer {
  color: var(--color-font-text);
  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;
  }

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

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

  .summary__time {
    margin-left: 48%;
  }

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

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

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

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

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

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

  .hero {
    margin-bottom: 30px;
  }

  h1 {
    font-size: 30px;
    letter-spacing: 0.02em;
    line-height: 40px;
  }

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

  .selectors,
  .vehicle-detail {
    display: grid;
  }

  .field,
  .field:nth-child(2) {
    min-width: 100%;
  }

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

  .summary {
    grid-area: 1 / 1 / 2 / 2;
    min-height: 528px;
    padding: 32px 24px 110px;
  }

  .summary__time {
    margin-left: 0;
  }

  .summary__time strong {
    font-size: 60px;
    line-height: 64px;
  }

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

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

  .summary__range small {
    font-size: 24px;
    line-height: 32px;
  }

  .summary__image {
    bottom: 1px;
    left: 50%;
    max-width: 118%;
    width: 430px;
  }

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

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

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

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

  .option {
    min-width: 78px;
  }

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