
#simple-calc {
    display: grid;
    grid-template-columns: minmax(1rem, auto) 1fr minmax(2rem, auto);
    /* width: calc(100vw - 2rem); */
    width: 100vw;
    margin: 0 auto;
}

#calculator {
    grid-column: 2 / 3;
    width: 100%;
    max-width: 1080px;
    padding: 2.5rem 0;
    box-sizing: border-box;
    margin: 0 auto;
}

.calculator-title {
    font-size: 1.6rem;
    margin-top: 2rem;
    margin-bottom: 4rem;
    text-align: center;
}
.calculator-title h2 {
    margin-bottom: 0.8rem;
}
.calculator-title p {
    margin-bottom: 1.6rem;
}

.calculator {
  position: relative;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    border: 1px solid #e9e9e9;
    border-radius: 6px;
    z-index: 999;
}


.calculator-inputs,
.calculator-outputs {
    width: clamp(400px, 50%, 620px);
    padding: 2.7rem;
    flex-grow: 1;
}

.calculator-inputs {
    border-radius: 4px 0 0 4px;
    background-color:#fefefe;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.calculator-outputs {
    border-radius: 0 4px 4px 0;
    background-color: var(--brand-light);
}

@media (max-width: 904px) {
    .calculator-inputs,
    .calculator-outputs {
        width: 100%;
        border-radius: 0;
        margin: 0;
    }
}

.icon {
    width: 1rem;
    height: 1rem;
    min-width: 1rem;
    aspect-ratio: 1;
}
.icon svg {
    object-fit: contain;
    width: 100%;
}



.calc-amount {
    position: relative;
    --calc-font-size: 1.5rem;
}

.calc-amount-values {
    position: relative;
    padding: 0 0 0 var(--calc-font-size);
}

.calc-amount-values:after {
    content: "£";
    position: absolute;
    bottom: 0.25rem;
    left: 0.2rem;
    font-size: var(--calc-font-size);
    font-weight: 500;
}


.calc-amount .input {
    background-color: var(--brand-light);
    display: flex;
    flex-direction: column;
    padding: 1rem;
    border-radius: 4px;
}
#calc-amount {
    font-family: 'Roboto', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    font-size: var(--calc-font-size);
    line-height: 1.5;
    font-weight: 300;
    background-color: transparent;
    border: 0;
    padding: 0;
    margin: 0rem 0;
    outline: 0;
    display: block;
}
#calc-amount:not(:focus-within) {
    display: none;
}

#calc-amount + p {
    font-size: var(--calc-font-size);
}
#calc-amount:focus-within + p {
    display: none;
}

.calc-amount-legend {
    font-size: 0.8rem;
    display: flex;
    gap: 0.5rem;
    align-items: center;
    padding: 0.25rem;
}
.calc-amount-legend p {
    font-size: 0.95rem;
    color: var(--color);
}
.calc-amount-legend .icon svg path { fill: var(--color);}

.calc-period {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 2.25rem;
}
.calc-period h3 {
    font-size: 1.3rem;
    margin-bottom: 0rem;
}
.calc-period h4 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--color);
    font-family: var(--font);
}

.slider-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

#calc-period {
    width: calc(100% - 1rem);
    margin: 0 1rem;
    padding: 0;
    background-color: transparent;
    border: 0;
    outline: 0;
    display: block;
}

.slider-container .slider-labels {
    display: flex;
    justify-content: space-between;
    width: calc(100% - 0.5rem);
    padding: 0 0.5rem 0 0.5rem;
  margin-left: 0.4rem;
    /* margin-right: 1rem; */
}

input[type=range] {
    --webkit-appearance: none;
    background: transparent;
}
  
  /* input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
  } */
  
  input[type=range]:focus {
    outline: none; /* Removes the blue border. You should probably do some kind of focus styling for accessibility reasons though. */
  }
  
  input[type=range]::-ms-track {
    width: calc(100% - 2rem);
    cursor: pointer;
  
    /* Hides the slider so custom styles can be added */
    background: transparent; 
    border-color: transparent;
    color: transparent;
  }



  input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 25px;
    height: 25px;
    background: var(--color);
    cursor: pointer;
    margin-top: -8px;
    border-radius: 13px;
  }
  
  input[type=range]::-moz-range-thumb {
    width: 25px;
    height: 25px;
    background: var(--color);
    cursor: pointer;
    margin-top: -8px;
    border-radius: 13px;
  }

input[type=range]::-webkit-slider-runnable-track {
    width: calc(100% - 2rem);
    height: 8.4px;
    cursor: pointer;
    /* box-shadow: 1px 1px 1px #000000, 0px 0px 1px #0d0d0d; */
    background: #e3e3e3;
    border-radius: 6px;
  }

  .slider-legend {
    margin-top: 2rem;
    display: flex;
    gap: 0.5rem;
  }


  .slider-legend p {
    font-size: 0.8rem;
  }
  .slider-legend p span {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--color);
    margin-right: 0.5rem;
  }


  /*/ RIGHT SIDE /*/

  .calc-result {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }
  
  .calc-result p {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: color-mix(in srgb, var(--color) 50%, black 50%);
  }

  .calc-table {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 2rem;
    margin-bottom: 2rem;
  }

  .calc-table-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
  }

  .calc-table-cell:nth-child(2) p {
    text-align: right;
  }

  .calc-table-row:last-child .calc-table-cell p { font-weight: 500;}
  
  .calc-cta {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
  }
  .calc-cta p {
    text-align: center;
    margin-top: 2rem;
    text-wrap: balance;
    color: color-mix(in srgb, var(--color) 50%, black 50%);
  }
  .calc-cta a {
    text-align: center;
    font-size: 1.0rem;
    color: var(--brand);
    font-weight: 500;
  }

  .calc-cta a:hover {
    text-decoration: underline;
  }

  .calc-cta .cta-button {
    color: white;
    font-size: 1.2rem;
    margin-top: 2rem;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    background-color: var(--brand);
    padding: 0.5rem;
    text-decoration: none;
    border-radius: 6px;
    opacity: 0.9;

  }
  .calc-cta .cta-button-smaller {
    font-size: 1.0rem;
    padding: 0.4rem 1.2rem;
    border-radius: 4px;
    width: auto;

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 0rem;

  }
  .calc-cta .cta-button-smaller p { 
    margin: 0;
    text-wrap: balance; 
    color: white;
  }

  .calc-cta .cta-button:hover {
    opacity: 1;
    text-decoration: none;
    background-color: rgb(224, 138, 72);
  }