.credit-calculator {
  width: 100vw;
  margin-top: 220px;
  color: #f6f0ec;
}

.credit-calculator > .container {
  width: calc(100% - 32px);
  max-width: 1216px;
  padding: 0;
}

.credit-calculator__body {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 512fr) minmax(0, 584fr);
  gap: 40px;
  min-height: 601px;
  padding: 40px;
  border-radius: 40px;
  background: #3e3a39;
}

.credit-calculator__car {
  position: absolute;
  top: -133px;
  right: -30px;
  width: 54%;
  height: auto;
  pointer-events: none;
}

.credit-calculator__intro {
  grid-column: 1;
}

.credit-calculator h2 {
  margin: 0 0 16px;
  font-size: 32px;
  font-weight: 700;
  line-height: 40px;
}

.credit-calculator__intro p {
  font-size: 16px;
  line-height: 24px;
}

.credit-calculator__controls {
  grid-column: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
  min-width: 0;
  min-height: 376px;
}

.credit-calculator__selects {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.credit-calculator select {
  width: 100%;
  min-width: 0;
  height: 51px;
  padding: 12px 30px 12px 12px;
  border: 1px solid #f6f0ec;
  border-radius: 16px;
  background-color: transparent;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath d='m3 6 5 5 5-5' fill='none' stroke='%23f6f0ec' stroke-width='1.5'/%3E%3C/svg%3E");
  background-size: 16px;
  background-position: right 12px center;
  color: #f6f0ec;
  font: inherit;
  font-size: 16px;
  line-height: 24px;
}

.credit-calculator select option {
  background: #3e3a39;
  color: #f6f0ec;
}

.credit-calculator__ranges {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.credit-calculator__range {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.credit-calculator__range > span {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 16px;
  line-height: 24px;
}

.credit-calculator__range b {
  white-space: nowrap;
}

.credit-calculator input[type="range"] {
  display: block;
  width: 100%;
  height: 30px;
  margin: 0;
  padding: 0;
  appearance: none;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.credit-calculator input[type="range"]::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 6px;
  background: linear-gradient(to right, #b3292c var(--range-progress), #f6f0ec var(--range-progress));
}

.credit-calculator input[type="range"]::-moz-range-track {
  height: 6px;
  border-radius: 6px;
  background: linear-gradient(to right, #b3292c var(--range-progress), #f6f0ec var(--range-progress));
}

.credit-calculator input[type="range"]::-webkit-slider-thumb {
  width: 30px;
  height: 30px;
  margin-top: -12px;
  appearance: none;
  border: 12px solid #b3292c;
  border-radius: 50%;
  background: #f6f0ec;
}

.credit-calculator input[type="range"]::-moz-range-thumb {
  box-sizing: border-box;
  width: 30px;
  height: 30px;
  border: 12px solid #b3292c;
  border-radius: 50%;
  background: #f6f0ec;
}

.credit-calculator__programs {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}

.credit-calculator__programs button {
  padding: 14px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #f6f0ec;
  font: inherit;
  font-size: 16px;
  line-height: 20px;
  cursor: pointer;
}

.credit-calculator__programs button.active {
  background: #b3292c;
}

.credit-calculator__result {
  grid-column: 2;
  grid-row: 2;
  align-self: end;
  min-width: 0;
  padding: 24px;
  border-radius: 24px;
  background: #f6f0ec;
  color: #3e3a39;
}

.credit-calculator__figures {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 32px 24px;
}

.credit-calculator__figures strong {
  display: block;
  margin-bottom: 4px;
  color: #b3292c;
  font-size: 32px;
  font-weight: 700;
  line-height: 40px;
}

.credit-calculator__figures span {
  font-size: 16px;
  line-height: 24px;
}

.credit-calculator__footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 264px);
  align-items: end;
  gap: 24px;
  margin-top: 32px;
}

.credit-calculator__footer p {
  font-size: 12px;
  line-height: 16px;
}

.credit-calculator__footer .btn {
  min-width: 0;
  min-height: 60px;
  padding: 16px;
  border-radius: 16px;
  background: #b3292c;
  color: #f6f0ec;
  font-size: 20px;
  font-weight: 400;
  line-height: 24px;
  white-space: nowrap;
}

.credit-calculator__footer svg {
  flex-shrink: 0;
}

.credit-calculator button:focus-visible,
.credit-calculator select:focus-visible,
.credit-calculator input:focus-visible {
  outline: 2px solid #b3292c;
  outline-offset: 4px;
}

@media (max-width: 1100px) {
  .credit-calculator__body {
    padding: 24px;
    gap: 24px;
  }

  .credit-calculator__car {
    top: -100px;
    right: 0;
    width: 50%;
  }

  .credit-calculator__figures strong {
    font-size: 26px;
    line-height: 34px;
  }

  .credit-calculator__footer {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }

  .credit-calculator__programs button {
    padding: 12px 8px;
    font-size: 14px;
  }
}

@media (max-width: 767px) {
  .credit-calculator {
    margin-top: 48px;
  }

  .credit-calculator__body {
    grid-template-columns: minmax(0, 1fr);
    padding: 16px;
    border-radius: 24px;
  }

  .credit-calculator__car {
    display: none;
  }

  .credit-calculator h2 {
    margin-bottom: 12px;
    font-size: 24px;
    line-height: 32px;
  }

  .credit-calculator__intro {
    grid-row: 1;
  }

  .credit-calculator__controls {
    grid-row: 2;
    min-height: 0;
  }

  .credit-calculator__selects {
    grid-template-columns: minmax(0, 1fr);
  }

  .credit-calculator select {
    border-radius: 8px;
  }

  .credit-calculator__range > span {
    font-size: 16px;
    line-height: 24px;
  }

  .credit-calculator__programs {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .credit-calculator__programs button {
    position: relative;
    flex: 0 0 auto;
    padding: 14px 12px;
    font-size: 16px;
    line-height: 20px;
    white-space: nowrap;
  }

  .credit-calculator__programs button:not(.active):not(:last-child)::after {
    content: '';
    position: absolute;
    top: 16px;
    right: 0;
    bottom: 16px;
    width: 1px;
    background: #f6f0ec;
  }

  .credit-calculator__result {
    grid-column: 1;
    grid-row: 3;
    padding: 16px;
    border-radius: 8px;
  }

  .credit-calculator__figures {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
  }

  .credit-calculator__figures strong {
    font-size: 32px;
    line-height: 40px;
    white-space: nowrap;
  }

  .credit-calculator__figures span {
    font-size: 16px;
    line-height: 24px;
  }

  .credit-calculator__footer {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    margin-top: 16px;
  }

  .credit-calculator__footer .btn {
    order: -1;
    min-height: 56px;
    border-radius: 8px;
    font-size: 18px;
  }
}
