@import url("https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,200..800;1,200..800&display=swap");

:root {
  --Lime: hsl(61, 70%, 52%);
  --Lime-hover: rgba(215, 218, 47, 0.7);
  --Lime-radio: rgb(246, 247, 210);
  --Red: hsl(4, 69%, 50%);

  --White: hsl(0, 0%, 100%);
  --Slate-100: hsl(202, 86%, 94%);
  --Slate-300: hsl(203, 41%, 72%);
  --Slate-500: hsl(200, 26%, 54%);
  --Slate-700: hsl(200, 24%, 40%);
  --Slate-900: hsl(202, 55%, 16%);
  --Slate-950: hsl(200, 77%, 10%);
}

body {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Plus Jakarta Sans", sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 100%;
}

button {
  cursor: pointer;
}

.container {
  height: 100vh;
  width: 100%;
  background-color: var(--Slate-100);

  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.calculator-container {
  max-width: 860px;
  background-color: var(--White);

  display: flex;
  justify-content: space-between;

  border-radius: 1.2rem;
  box-shadow: 0px 0px 40px rgba(0, 0, 0, 0.2);
}

.calculator {
  flex: 1;
  padding: 2.5rem 2rem;
}

.calculator-header {
  margin-bottom: 1.5rem;

  display: flex;
  align-items: center;
  justify-content: space-between;
}

.calculator-header h2 {
  font-size: 1.6rem;
}

.calculator-button-clear {
  border: none;
  background: none;
  text-decoration: underline;
  font-size: 0.9rem;
  color: var(--Slate-900);
}

.calculator-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  align-items: flex-start;
}

.input-symbol-left {
  height: 38px;
  padding: 0 1rem;
  position: absolute;
  bottom: 1px;
  left: 1px;
  background-color: var(--Slate-100);
  z-index: 1000;
  color: var(--Slate-900);
  border-bottom-left-radius: 4px;
  border-top-left-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  font-size: 1.1rem;
}

.input-symbol-right {
  height: 38px;
  padding: 0 1rem;
  position: absolute;
  bottom: 1px;
  right: 1px;
  background-color: var(--Slate-100);
  z-index: 1000;
  color: var(--Slate-900);
  border-bottom-right-radius: 4px;
  border-top-right-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  font-size: 1.1rem;
}

.input-amount-div {
  width: 100%;
  position: relative;
}

.input-amount-div input {
  padding-left: 60px;
}

.input-amount-div input:focus {
  border: 1px solid var(--Lime);
}
.input-amount-div input:focus ~ .input-symbol-left {
  background-color: var(--Lime);
}

.input-term-div,
.input-rate-div {
  position: relative;
}

.input-term-div input,
.input-rate-div input {
  padding-left: 20px;
}

.input-term-div input:focus {
  border: 1px solid var(--Lime);
}
.input-term-div input:focus ~ .input-symbol-right {
  background-color: var(--Lime);
}

.input-rate-div input:focus {
  border: 1px solid var(--Lime);
}
.input-rate-div input:focus ~ .input-symbol-right {
  background-color: var(--Lime);
}

input {
    display: block;
    height: 40px;
    width: 100%;

    font-size: 1.3rem;
    font-weight: 400;

    border: 1px solid var(--Slate-700);
    border-radius: 4px;
}

input:focus {
    outline: none;
}

label {
    display: block;
    margin-bottom: 10px;
    cursor: pointer;
    color: var(--Slate-900);
    font-weight: 500;
}

.input-term-rate {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.submit {
    padding: 0.8rem 2.5rem;
    background-color: var(--Lime);
    border: none;
    font-size: 1rem;
    font-weight: 700;
    color: var(--Slate-900);
    border-radius: 50rem;

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;

    transition: all 0.3s ease;
}

.submit:hover {
    background-color: var(--Lime-hover);
}

.radio-input-box {
    width: 100%;
}

.radio-input {
    display: none;
}

.radio-label {
  position: relative;
  color: var(--Slate-900);
  cursor: pointer;
  gap: 1.3rem;
  border: 1px solid var(--Slate-900);
  padding: 0.7rem 1.5rem;
  display: inline-flex;
  font-weight: bold;
  font-size: 1.1rem;
  width: 100%;

  transition: all 0.3s ease;

  align-items: center;
}

.radio-label:hover {
  border: 1px solid var(--Lime);
}

.radio-label::before {
  content: "";
  height: 1.3rem;
  width: 1.3rem;
  border: 2px solid var(--Slate-900);
  border-radius: 50%;
}

.radio-input:checked + .radio-label::after {
  content: "";
  height: 0.9rem;
  width: 0.9rem;
  background-color: var(--Lime);
  border-radius: 50%;
  position: absolute;
  left: 1.84rem;
}

.radio-input:checked + .radio-label::before {
  border: 2px solid var(--Lime);
}

.radio-input:checked + .radio-label {
  border: 1px solid var(--Lime);
  background-color: var(--Lime-radio);
}

/*////////////////////////////////////     RESULTS     /////////////////////////////////// */
.result {
    background-color: var(--Slate-900);
  flex: 1;
  height: 100%;
  width: 400px;
  padding: 2.5rem 2rem;
  
  border-bottom-left-radius: 3rem;
  border-top-right-radius: 1.2rem;
  border-bottom-right-radius: 1.2rem;
  
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.result-header {
  color: var(--Slate-100);
}

.result-header .result-heading {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.result-header .result-para {
    font-size: 0.9rem;
  line-height: 1.5;
  font-weight: lighter;
  color: var(--Slate-300);
  margin-bottom: 3rem;
}

.result-figures-box {
  width: 100%;
  background-color: var(--Slate-950);
  border-top: 3px solid var(--Lime);
  border-radius: 10px;
  padding: 1.5rem 1.9rem 2rem;
}

.monthly-figures {
  padding-bottom: 1.6rem;
  border-bottom: 2px solid rgba(154, 190, 213, 0.5);
}

.figures-type {
  font-size: 0.95rem;
  line-height: 1.5;
  font-weight: lighter;
  color: var(--Slate-300);
  margin-bottom: 0.8rem;
}

.monthly-amount {
  font-size: 2.8rem;
  color: var(--Lime);
  font-weight: bolder;
}

.total-figures {
  padding-top: 1.6rem;
}

.total-figures .total-amount {
  font-size: 1.5rem;
  color: var(--Slate-100);
  font-weight: bold;
}

.total-figures .figures-type {
  margin-bottom: 0.4rem;
  color: var(--Slate-300);
}

.result-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 2rem;

  margin-top: 4rem;
}

.result-empty .result-header {
  text-align: center;
}


/*////////////////////////////////////     MEDIA QUERIES     /////////////////////////////////// */

/* Media Query for Large Screens (min-width: 1440px) */
@media only screen and (min-width: 1440px) {
}

/* For devices between 1024px and 1439px (laptops and desktops) */
@media only screen and (max-width: 1439px) and (min-width: 1024px) {
}

/* For tablets (max-width: 1023px and min-width: 768px) */
@media only screen and (max-width: 1023px) and (min-width: 768px) {
  html {
    font-size: 75%;
  }

  .calculator-container {
    max-width: 700px;
  }

  .calculator-button-clear {
    font-size: 1.2rem;
  }
}

/* For small devices like smartphones (max-width: 767px) */
@media only screen and (max-width: 767px) and (min-width: 580px) {
  html {
    font-size: 62.5%;
  }

  .container {
    height: fit-content;
    width: 100%;
    padding: 2rem;
  }

  .calculator-container {
    max-width: 400px;
    flex-direction: column;
    border-radius: 2rem;
  }

  .result {
    flex: 1;
    width: 100%;
    height: 100%;

    border-radius: 4rem 4rem 2rem 2rem;
  }

  .calculator-button-clear {
    font-size: 1.5rem;
  }

  .calculator-header {
    margin-bottom: 2rem;
  }

  .calculator-header h2 {
    font-size: 2rem;
  }

  label {
    font-size: 1.4rem;
  }

  .submit {
    font-size: 1.3rem;
  }

  .radio-input:checked + .radio-label::after {
    left: 1.9rem;
  }
}

/* For very small devices (max-width: 480px) */
@media only screen and (max-width: 579px) {
  .container {
    height: fit-content;
    width: 100%;
  }

  .calculator-container {
    max-width: 100%;
    flex-direction: column;
    border-radius: 0;
  }

  .calculator-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.9rem;
    margin-bottom: 2rem;
  }

  .calculator-header h2 {
    font-size: 1.6rem;
  }

  .calculator-button-clear {
    font-size: 1.2rem;
  }

  .result {
    flex: 1;
    width: 100%;
    height: 100%;
    border-radius: 0;
  }
}
