/*
  1. Use a more-intuitive box-sizing model.
*/
*,
*::before,
*::after {
  box-sizing: border-box;
}
/*
    2. Remove default margin
  */
* {
  margin: 0;
}
/*
    Typographic tweaks!
    3. Add accessible line-height
    4. Improve text rendering
  */
body {
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
/*
    5. Improve media defaults
  */
img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}
/*
    6. Remove built-in form typography styles
  */
input,
button,
textarea,
select {
  font: inherit;
}
/*
    7. Avoid text overflows
  */
p,
h1,
h2,
h3,
h4,
h5,
h6 {
  overflow-wrap: break-word;
}
/*
    8. Create a root stacking context
  */
#root,
#__next {
  isolation: isolate;
}

:root {
  --clr-lime: hsl(61, 70%, 52%);
  --clr-red: hsl(4, 69%, 50%);

  --clr-White: hsl(0, 0%, 100%);
  --clr-Slate-100: hsl(202, 86%, 94%);
  --clr-Slate-300: hsl(203, 41%, 72%);
  --clr-Slate-500: hsl(200, 26%, 54%);
  --clr-Slate-700: hsl(200, 24%, 40%);
  --clr-Slate-900: hsl(202, 55%, 16%);

  --ff: "Plus Jakarta Sans", sans-serif;
  --fw-light: 500;
  --fw-bold: 700;
}

body {
  background-color: var(--clr-Slate-100);
  display: flex;
  justify-content: center;
  align-content: center;
  height: 100%;
  font-family: var(--ff);
}

h1 {
  color: var(--clr-Slate-900);
}

hr{
  border: 1px solid #4B5563; /* Adjust color as needed */
  margin: 0 10px;
}

button:hover {
  cursor: pointer;
}

label {
  color: var(--clr-Slate-700);
}

.form {
  background-color: white;
  min-height: 38rem;
}

label {
  margin-bottom: 0.5rem;
}

.form__within {
  display: flex;
  flex-direction: column;
  height: 100%;
  gap: 1.5rem;
  padding: 1rem 1.5rem;
}

.form__reset {
  border: none;
  background-color: white;
  color: var(--clr-Slate-700);
  text-decoration: underline;
}

.form__reset:hover {
  cursor: pointer;
}

.form__mortgage {
  display: flex;
  flex-direction: column;
}

.form__mortgage__type label {
  margin: 0;
}

.form__term__rate {
  display: flex;
  flex-direction: column;
  gap: inherit;
}

.term {
  display: flex;
  flex-direction: column;
}

.rate {
  display: flex;
  flex-direction: column;
}

.form__mortgage__type {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.5rem;
}

.repayment {
  display: flex;
  align-items: center;
  border: 1px solid var(--clr-Slate-500);
  height: 2.5rem;
  border-radius: 5px;
}

.interest input {
  margin-left: 1rem;
}

.repayment input {
  margin-left: 1rem;
}

.repayment label {
  font-weight: var(--fw-bold);
  color: var(--clr-Slate-900);
  margin: 0;
}

.interest {
  display: flex;
  align-items: center;
  border: 1px solid var(--clr-Slate-500);
  height: 2.5rem;
  border-radius: 5px;
}

.interest label {
  font-weight: var(--fw-bold);
  color: var(--clr-Slate-900);
  margin: 0;
}

input[type="radio"] {
  margin-right: 1rem;
  width: 1.2em;
  height: 1.2rem;
  accent-color: var(--clr-lime);
}

.repayment:focus-within {
  background-color: #fafae0;
  border-color: var(--clr-lime);
  accent-color: #fafae0;
}

.interest:focus-within {
  background-color: #fafae0;
  border-color: var(--clr-lime);
}

input[type="number"] {
  height: 2.5rem;
  width: 100%;
  border: none;
  padding-left: 1rem;
  -moz-appearance: textfield;
}

.icon {
  display: flex;
  align-items: center;
}

.icon__container {
  display: flex;
  width: 100%;
  border: 1px solid var(--clr-Slate-700);
  border-radius: 5px;
}

.icon__container:hover {
  border: 1px solid var(--clr-lime);
}

.amount__icon {
  display: flex;
  background-color: var(--clr-Slate-100);
  width: 15%;
  justify-content: center;
  font-weight: var(--fw-bold);
  color: var(--clr-Slate-700);
  border-top-left-radius: 5px;
  border-bottom-left-radius: 5px;
}

.term__icon {
  display: flex;
  background-color: var(--clr-Slate-100);
  width: 25%;
  justify-content: center;
  font-weight: var(--fw-bold);
  color: var(--clr-Slate-700);
  border-bottom-left-radius: 5px;
  border-top-right-radius: 5px;
}

.interest__icon {
  display: flex;
  background-color: var(--clr-Slate-100);
  width: 15%;
  justify-content: center;
  font-weight: var(--fw-bold);
  color: var(--clr-Slate-700);
  border-bottom-left-radius: 5px;
  border-top-right-radius: 5px;
}

.icon__container:hover .term__icon,
.icon__container:focus-within .term__icon {
  background-color: var(--clr-lime);
}

.icon__container:hover .amount__icon,
.icon__container:focus-within .amount__icon {
  background-color: var(--clr-lime);
}

.icon__container:hover .interest__icon,
.icon__container:focus-within .interest__icon {
  background-color: var(--clr-lime);
}

.icon__container:focus-within {
  border-color: var(--clr-lime);
}

input:focus {
  outline: none;
}

.form__calc button {
  display: flex;
  justify-content: center;
  align-items: center;

  width: 100%;
  border: none;
  background-color: var(--clr-lime);

  color: var(--clr-Slate-900);
  font-weight: var(--fw-bold);
  height: 2.5rem;
  border-radius: 2rem;
}

.form__calc button::before {
  display: flex;
  content: "";
  width: 30px;
  height: 30px;
  background-repeat: no-repeat;
  background-position: center;
  background-image: url(./assets/images/icon-calculator.svg);
  margin-right: 0.3rem;
}

.results__empty {
  display: flex;
  background-color: var(--clr-Slate-900);
}

.results__empty__text {
  display: flex;
  flex-direction: column;
  margin: 2rem 2rem;
  justify-content: center;
  align-items: center;
  text-align: center;
  color: white;
  gap: 1rem;
}

.hidden {
  display: none;
}

.results__calculated{
  display: flex;
  background-color: var(--clr-Slate-900);
  
}

.results__calculated__text{
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin: 2rem 1rem;
  color: white;
}

.results__calculated__text{
  color: var(--clr-Slate-300);
  font-size: 0.8rem;
  line-height: 1.5;
}

.results__calculated__done{
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 100%;
  background-color:#0e2431;
  min-height: 12rem;
}

.monthly__repayments, .monthly__term{
  margin: 1rem 1rem;
}


.monthly__repayments__answer{
  color: var(--clr-lime);
  font-weight: var(--fw-bold);
  font-size: 2.5rem;
}

.monthly__term__answer{
  color: white;
  font-weight: var(--fw-bold);
  font-size: 1.5rem;
}

@media (min-width: 30rem){
  .mortgage__calculator{
    display: flex;

  }

  form{
    width: 50%;
    margin-left: 10rem;
  }

  .results__empty{
    width: 50%;
  }

  .results__calculated{
    width: 50%;
    display: flex;
    align-items: center;
  }

  .hidden {
    display: none;
  }
  

}

