@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,200..800;1,200..800&display=swap');

/* * {
  outline: 1px solid red;
} */

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: #DFEFF7;
    display: grid;
    place-items: center;
    height: 100vh;
}

.calculator-container {
    display: flex;
    flex-direction: column;
    max-width: 1300px;
    background-color: white;
}

.calculator-panel {
  padding: 20px;
}

.top .title {
  font-size: 1.8rem;
  color: #133040;
}

.top {
  margin-bottom: 20px;
}

.top .title {
  font-size: 1.2rem;
}

.clear {
  font-size: 0.8rem;
}

h2 {
  font-size: 0.8rem;
}

.amount-container, .term, .rate {
  margin: 20px 0;
}

input {
  min-width: 0;
  padding: 10px;
}

.calculator-panel h2 {
  margin-bottom: 10px;
}

#submitBtn {
  margin-top: 15px;
  font-weight: 700;
}

.rate {
  min-width: 0;
  flex: 1;
}

input[type='radio'] {
  transform: scale(1.5);
}


h2 {
  color: hsl(200, 24%, 40%);
  font-size: 1rem;
  font-weight: 600;
}


.clear {
  all: unset;
  text-decoration: underline;
  text-underline-offset: 0.1rem;
  color: hsl(200, 24%, 40%);
  margin-left: auto;
  font-size: 1rem;
  font-weight: 500;
}

.clear:hover {
  cursor: pointer;
}

.input-group input {
  border: none;
  outline: none;
  flex-grow: 1;
}

.input-group {
  outline: 1px solid hsl(200, 24%, 40%);
  border-radius: 2px;
  display: flex;
}

.input-group label {
  background-color: #E4F3FC;
  color: hsl(200, 24%, 40%);
  padding: 8px 12px;
  font-weight: 700;
  font-size: 1rem;
  display: grid;
  place-items: center;
  transition: background-color 0.2s ease-in-out;
}

.input-group:has(input:focus) {
  outline: 1px solid #D9DB30;
}

.input-group:has(input:focus) label {
  background-color: #D9DB30;
}

.amount-container label {
  margin-right: 10px;
}

.term-rate-container input {
  margin-left: 10px;
}

.input-group input {
  font-weight: 600;
  color: #133040;
}

.mortgage-type label {
  font-size: 1rem;
}

.option1, .option2 {
  display: flex;
  align-items: center;
  outline: 1px solid hsl(200, 24%, 40%);
  color: #133040;
  border-radius: 3px;
  padding: 8px 0 8px 10px;
  font-weight: 700;
  font-size: 0.9rem;
  margin: 10px 0;
  transition: background-color 0.2s ease-in-out;
}

.custom-radio-btn {
  width: 15px;
  height: 15px;
  margin-right: 10px;
  border: 1px solid #444;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.custom-radio-btn .checkmark {
  width: calc(100% - 3px);
  height: calc(100% - 3px);
  border-radius: 50%;
  background-color: #D9DB30;
  display: none;
}

.custom-radio-btn input {
  display: none;
}

.custom-radio-btn input:checked + .checkmark {
  display: inline-block;
}

.custom-radio-btn:has(input:checked) {
  border: 2px solid #D9DB30;
}

.option1:has(.custom-radio-btn input:checked), .option2:has(.custom-radio-btn input:checked) {
  background-color: #FAFAE0;
  outline: 1px solid #D9DB30;
}


button {
  all: unset;
  display: flex;
  gap: 5px;
  color: #133040;
  padding: 15px 50px;
  border-radius: 25px;
  font-weight: 700;
  background-color: #D9DB30;
  transition: background-color 0.2s ease-in-out;
}

.btn-section {
  display: grid;
  place-items: center;
}

.error, #mortgageTypeError {
  color: red;
  font-size: 0.8rem;
  font-weight: 500;
  margin-top: 10px;
}

.results-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  padding: 30px;
}

.empty {
  display: flex;
  gap: 20px;
  padding: 10px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.empty[hidden] {
  display: none !important;
}


.empty img {
  width: 200px;
}

.empty .title {
  font-size: 1.5rem;
  font-weight: 600
}

.empty .instructions {
  font-size: 1rem;
  font-weight: 500;
  text-align: center;
  color: hsl(203, 41%, 72%);
}

.completed {
  height: 100%;
  width: 100%;
}

.completed .title {
  font-size: 1.3rem;
  font-weight: 500;
}

.completed .description {
  font-size: 0.8rem;
  color: hsl(203, 41%, 72%);
  margin-top: 10px;
  margin-bottom: 30px;
}

.completed .results {
  background-color: #0E2431;
  padding: 20px;
  border-radius: 5px;
  box-shadow: 0 -3px 0 #D9DB30;
}

.results .results-info {
  font-size: 0.8rem;
  color: hsl(203, 41%, 72%);
}

.results .monthly-cost {
  font-size: 2.5rem;
  color: #D9DB30;
  margin: 0;
}

.results hr {
  border: none;
  height: 1px;
  background-color: hsla(203, 41%, 72%, 0.423);
  margin: 20px 0;
}

.results .total-cost {
  margin-top: 5px;
  font-size: 1.3rem;
}

.results-panel {
    background-color: #133040;
    color: white;
}

.attribution {
  color: white;
}

.attribution a {
  color: #D9DB30;
}


@media (min-width: 900px) {
    .calculator-container {
        flex-direction: row;
        border-radius: 20px;
        max-width: 800px;
        box-shadow: 0 2px 10px rgb(0, 0, 0, 0.1);
    }

    .calculator-panel {
        min-width: 0;
        flex: 1;
        padding: 25px;
        border-radius: 20px 0 0 20px;
    }
    
    .top {
      display: flex;
      margin-bottom: 20px;
    }

    .top .title {
      font-size: 1.2rem;
    }

    .clear {
      font-size: 0.8rem;
    }

    .clear:hover {
      color: #133040;
    }

    h2 {
      font-size: 0.8rem;
    }

    .input-group:hover {
      outline: 1px solid black;
    }

    input:hover {
      cursor: pointer;
    }

    .amount-container {
      margin: 20px 0;
    }

    .term-rate-container {
      margin: 20px 0;
      display: flex;
    }

    .calculator-panel h2 {
      margin-bottom: 10px;
    }

    #submitBtn {
      padding: 10px 30px;
      margin-top: 30px;
      font-weight: 700;
    }

    #submitBtn:hover {
      background-color: #EBEE97;
      cursor: pointer;
    }

    .btn-section {
      all: unset;
    }

    .rate {
      margin: 0;
      min-width: 0;
      flex: 1;
    }

    .term {
      margin: 0;
      min-width: 0;
      flex: 1;
      margin-right: 10px;
    }

    .term input, .rate input {
      min-width: 0;
    } 

    .option1:hover, .option2:hover {
      cursor: pointer;
      outline: 2px solid #EBEE97;
    }

    input[type='radio'] {
      transform: scale(1.2);
    }

    input {
      padding: 0;
    }

    
    .results-panel {
      display: flex;
      align-items: center;
      justify-content: center;
      flex: 1;
      padding: 30px;
      border-radius: 0 20px 20px 50px;
    }

    .empty {
      display: flex;
      gap: 20px;
      flex-direction: column;
      justify-content: center;
      align-items: center;
    }

    .empty img {
      width: 150px;
    }

    .empty .title {
      font-size: 1.3rem;
      font-weight: 600
    }

    .empty .instructions {
      font-size: 0.8rem;
      font-weight: 500;
      text-align: center;
      color: hsl(203, 41%, 72%);
    }

    
    .attribution {
      color: rgb(37, 36, 36);
    }

    .attribution a {
      color: #0E2431;
    }
}

/*
  Josh's Custom CSS Reset
  https://www.joshwcomeau.com/css/custom-css-reset/
*/

*, *::before, *::after {
    box-sizing: border-box;
  }
  
  *:not(dialog) {
    margin: 0;
  }
  
  @media (prefers-reduced-motion: no-preference) {
    html {
      interpolate-size: allow-keywords;
    }
  }
  
  body {
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
  }
  
  img, picture, video, canvas, svg {
    display: block;
    max-width: 100%;
  }
  
  input, button, textarea, select {
    font: inherit;
  }
  
  p, h1, h2, h3, h4, h5, h6 {
    overflow-wrap: break-word;
  }
  
  p {
    text-wrap: pretty;
  }
  h1, h2, h3, h4, h5, h6 {
    text-wrap: balance;
  }
  
  #root, #__next {
    isolation: isolate;
  }