@import 'multirange.css';
@import 'radio.css';

.main {
  position: relative;
}

.calc-overflow {
  background-image: url(../images/calc_summary.png);
  background-repeat: no-repeat;
  background-position: right top;
  position: absolute;
  width: 710px;
  height: 800px;
  top: 0;
  right: 0;
  margin-right: -150px;
  pointer-events: none;
}

.calc-app {
  background-image: url(../images/calc_bottom.png), url(../images/calc_top.png);
  background-repeat: no-repeat;
  background-position: right bottom, left top;
}

.calc-app .content-box {
  padding-top: 0;
}

.calc-app h1 {
  max-width: 540px;
}

.calc-box {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
}

.calc-tools,
.calc-summary {
  width: 50%;
}

.calc-tools {
  margin-top: 52px;
  margin-bottom: 128px;
}

.calc-item {
  margin-bottom: 75px;
  max-width: 550px;
}

.calc-item.text-only {
  margin-bottom: 35px;
}

.calc-item .radio-group {
  margin-bottom: 45px;
}

.calc-item h3 {
  font-weight: 600;
  font-size: 18px;
  margin: 0;
  margin-bottom: 35px;
}

.calc-item p {
  font-weight: normal;
  font-size: 16px;
  color: var(--comment-font-color);
  margin: 0;
  line-height: 170%;
}

.calc-summary {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.calc-summary .summary-card {
  background: #ffffff;
  box-shadow: 0px 32px 64px rgba(31, 54, 94, 0.04);
  border-radius: 8px;
  width: 100%;
  max-width: 468px;
  display: flex;
  align-self: flex-end;
  margin-bottom: 64px;
  margin-top: -52px;
  text-align: right;
}

.calc-summary .summary-card .summary-content {
  padding: 20px 30px 17px;
  width: 100%;
}

.calc-summary .more {
  width: 100%;
  max-width: 468px;
  display: flex;
  display: flex;
  align-self: flex-end;
}

.summary-card .header-start,
.summary-card .header-month {
  font-weight: 600;
  font-size: 18px;
  color: var(--secondary-font-color);
}

.summary-card .value-start,
.summary-card .value-month {
  color: var(--primary-font-color);
}

.summary-card .value-start {
  font-weight: 600;
  font-size: 32px;
  margin-top: 5px;
  margin-bottom: 47px;
}

.summary-card .value-month {
  font-weight: 600;
  font-size: 64px;
  margin-top: -2px;
  margin-bottom: 38px;
}

.summary-card .summary-row {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  margin-bottom: 20px;
}

.summary-card .summary-row:last-of-type {
  margin-bottom: 0;
}

.summary-card .summary-row div {
  max-width: 65%;
}

.summary-card .summary-row > div {
  text-align: left;
  line-height: 170%;
}

.radio-group {
  display: flex;
  flex-direction: row;
  justify-content: flex-start;
  flex-wrap: wrap;
}
.radio-group .single-radio {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  flex: 1 0 25%;
  max-width: 25%;
}

.radio-group .single-radio > input {
  flex: 1 0 10%;
  max-width: 10%;
}

.radio-group .single-radio > label {
  flex: 1 0 80%;
  max-width: 80%;
}

.multi-range {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

.multi-range .input {
  width: 17%;
}

.multi-range .noUi-target {
  width: 56%;
}

.payin-slider {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
}

.payin-slider #payinSlider,
.payin-slider #payoutSlider {
  flex: 1 0 70%;
  max-width: 70%;
}
.payin-slider input {
  flex: 1 0 auto;
  max-width: 128px;
}
.calc-slider-container .input {
  position: relative;
}
.calc-slider-container .input p {
  position: absolute;
  right: 0;
  top: 0;
  background-color: var(--grays-lighter);
  width: 46px;
  height: 96%;
  border-top-right-radius: 8px;
  border-bottom-right-radius: 8px;
  border: 1px solid #9fb7df;
  border-left: none;
  display: flex;
  justify-content: center;
  align-items: center;
}

.annual-return {
  margin-top: 100px;
}
.annual-return .noUi-pips-horizontal {
  top: -40px;
}
.annual-return .noUi-pips-horizontal > div.noUi-value {
  color: var(--comment-font-color);
}
.annual-return .noUi-pips-horizontal > div.noUi-marker {
  background: #e2e4e9;
}
.annual-return .noUi-pips-horizontal > div:nth-of-type(4n + 1) {
  background: var(--primary-font-color);
}
.annual-return .noUi-value-horizontal {
  transform: translate(-50%, -120%);
}
.annual-return .noUi-marker-horizontal.noUi-marker-large {
  height: 8px;
}

#less-than-60 {
  display: none;
  margin-bottom: 15px;
}

.noUi-connect::before {
  background-image: none;
  background-color: var(--primary-font-color);
}
.noUi-handle-lower,
.noUi-handle-upper {
  background-color: transparent;
  background-size: 24px;
  background: url(../images/calc-slider.svg) no-repeat center;
}

.tooltip {
  position: relative;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 14px;
  height: 14px;
  font-size: 12px;
  border: 3px solid var(--primary-font-color);
  border-radius: 100%;
  color: var(--primary-font-color);
  cursor: pointer;
  vertical-align: middle;
}

.tooltip .tooltiptext {
  visibility: hidden;
  width: 360px;
  height: 104px;
  background-color: rgba(31, 54, 94, 1);
  color: #fff;
  text-align: center;
  padding: 5px 10px;
  border-radius: 4px;
  position: absolute;
  z-index: 1;
  left: 100%;
  margin-left: 9px;
  opacity: 0;
  transition: opacity 0.3s;
  font-size: 14px;
  line-height: 1.7;
  display: flex;
  justify-content: center;
  align-items: center;
}

.tooltip .tooltiptext.visible {
  visibility: visible;
  opacity: 1;
}

.tooltip .tooltiptext::after {
  content: '';
  position: absolute;
  left: 0%;
  top: 51px;
  margin-left: -12px;
  border-width: 6px;
  border-style: solid;
  border-color: transparent rgba(31, 54, 94, 1) transparent transparent;
}

.tooltip:hover .tooltiptext {
  visibility: visible;
  opacity: 1;
}

@media only screen and (max-width: 1024px) {
  .calc-box {
    flex-direction: column;
  }

  .calc-summary {
    order: 1;
  }

  .calc-tools {
    order: 2;
  }

  .calc-tools,
  .calc-summary {
    width: 100%;
  }

  .calc-overflow {
    display: none;
  }

  .calc-summary .summary-card {
    max-width: none;
    margin-top: 0;
    text-align: center;
  }

  .calc-summary .more {
    width: 100%;
    max-width: none;
  }

  .calc-summary .more a {
    margin: 0 auto;
  }

  .summary-card .value-month {
    font-size: 50px;
  }
}

@media only screen and (max-width: 768px) {
  h1 {
    margin-top: 24px;
  }
  .calc-tools {
    order: 1;
    margin-bottom: 0;
  }

  .calc-item:last-of-type {
    margin-bottom: 0;
  }

  .calc-summary {
    order: 2;
  }

  .calc-item {
    max-width: 100%;
  }

  .calc-item .radio-group {
    margin-bottom: 25px;
  }

  .payin-slider {
    flex-wrap: wrap;
    align-items: flex-start;
  }

  #payoutSliderContainer .input {
    margin-bottom: 25px;
  }

  .payin-slider #payinSlider,
  .payin-slider #payoutSlider,
  .multi-range .noUi-target {
    flex: 1 0 100%;
    max-width: 100%;
    width: 100%;
  }

  .calc-slider-container .input {
    margin-top: 30px;
  }

  .multi-range .input {
    order: 2;
    width: 48%;
  }

  .calc-summary .summary-card {
    text-align: right;
    margin-bottom: 25px;
  }

  .calc-summary .more {
    margin-bottom: 25px;
  }

  .tooltip {
    position: initial;
  }

  .tooltip .tooltiptext {
    width: 100%;
    left: 0;
    margin-bottom: 180px;
    margin-left: 0;
  }

  .tooltip .tooltiptext::after {
    display: none;
  }
}
