@font-face {
    font-family: "Jakarta";
    src: url("assets/fonts/PlusJakartaSans-VariableFont_wght.ttf");
}

:root {
    font-family: "Jakarta", sans-serif;
    --lime: hsl(61, 70%, 52%);
    --dead-lime: hsl(62, 72%, 76%);
    --light-lime: hsl(60, 72%, 93%);
    --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-1200: hsl(202, 56%, 12%);
}

::selection {
    background-color: var(--lime);
    color: var(--slate-900);
}

html, body {
    margin: 0;
    background-color: var(--slate-100);
    display: flex;
    justify-content: center;
}

.mainContainer {
    margin-top: 150px;
    display: flex;
    flex-direction: row;
    box-shadow: 0 0 25px var(--slate-300);
    background-color: var(--white);
    overflow: hidden;
    border-radius: 30px;
}

.calculatorContainer{
    width: 500px;
    padding-left: 35px;
    padding-right: 35px;
    padding-top: 35px;
    background-color: var(--white);
    border-top-left-radius: 30px;
    border-bottom-left-radius: 30px;
}

.calculatorContainer h1 {
    font-size: 28px;
    color: var(--slate-900);
    margin: 0;
}

.calculatorContainer p {
    font-size: 18px;
    color: var(--slate-700);
    font-weight: 500;
}

.ResultsContainer {
    width: 500px;
    background-color: var(--slate-900);
    border-top-right-radius: 30px;
    border-bottom-right-radius: 30px;
    border-bottom-left-radius: 115px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.defaultResultsContainer img {
    width: 200px;
}

.defaultResultsContainer h2 {
    color: var(--white);
    margin: 10px;
}

.defaultResultsContainer p {
    color: var(--slate-500);
    margin-left: 30px;
    margin-right: 30px;
}

.withResultsContainer {
    padding-right: 35px;
    padding-left: 35px;
    padding-bottom: 35px;
    font-weight: 500;
}

.withResultsContainer h2 {
    color: var(--white);
    text-align: left;
}

.withResultsContainer p {
    color: var(--slate-500);
    text-align: left;
}

.finalResultContainer {
    margin-top: 30px;
    background-color: var(--slate-1200);
    border-top: 3px solid var(--lime);
    border-radius: 8px;
    padding: 35px;
}

.finalResultContainer hr {
    color: var(--slate-500);
}

#monthlyRepayments {
    font-weight: 900;
    font-size: 50px;
    color: var(--lime);
    margin-top: 10px;
    margin-bottom: 10px;
}

#totalRepayments {
    font-weight: 700;
    font-size: 30px;
    color: var(--white);
    margin-top: 10px;
    margin-bottom: 10px;
}

#calculator {
    display: flex;
    flex-direction: row;
    background-color: var(--lime);
    border-radius: 60px;
    cursor: pointer;
    padding-left: 35px;
    padding-right: 35px;
    border: none;
    transition: 0.3s;
    margin: 25px auto 35px auto;
}

#calculator:hover {
    background-color: var(--dead-lime);
    transition: 0.3s;
}

#calculator p {
    font-family: "Jakarta", sans-serif;
    color: var(--slate-900);
    font-weight: 900;
    font-size: 16px;
    margin-left: 20px;
}

#clearAllButton {
    font-family: "Jakarta", sans-serif;
    text-decoration: underline;
    border: none;
    background-color: var(--white);
    color: var(--slate-700);
    cursor: pointer;
    font-size: 16px;
}

#clearAllButton:hover {
    color: var(--slate-900)
}

.titleRow {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    margin-bottom: 40px;
}

.moneyInputContainer {
    display: flex;
    flex-direction: row;
    border: 1px solid var(--slate-500);
    border-radius: 8px;
}

.moneySymbol, .yearsSymbol, .percentageSymbol {
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: var(--slate-100);
    color: var(--slate-700);
    font-weight: 500;
    font-size: 18px;
    padding: 14px;
    padding-left: 16px;
    padding-right: 16px;
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
}

input[type=number] {
    appearance: textfield;
    border: 0;
    width: 100%;
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
    font-size: 20px;
    padding-right: 15px;
    padding-left: 15px;
    color: var(--slate-900);
    font-family: "Jakarta", sans-serif;
    font-weight: 700;
}

input[type=number]:focus {
    outline: none;
}

.moneyInputContainer:has(input[type="number"]:focus) {
    border: 1px solid var(--lime);
}

.moneySymbol:has(+ input[type="number"]:focus) {
    background-color: var(--lime);
    color: var(--slate-900)
}

.termInterestContainer{
    display: flex;
    flex-direction: row;
    justify-content: space-between;
}

.mortgageInput, .percentageInput {
    display: flex;
    flex-direction: row;
    border: 1px solid var(--slate-500);
    border-radius: 8px;
    justify-content: space-between;
}

.mortgageTerm {
    margin-right: 30px;
}

#mortgageTermInput, #interestInput {
    border-radius: 8px;
    padding: 14px;

    padding-left: 16px;
    padding-right: 16px;
}

.yearsSymbol, .percentageSymbol {
    border-top-left-radius: 0px;
    border-bottom-left-radius: 0px;

    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
}

.mortgageInput input[type="number"]:focus + .yearsSymbol {
  background-color: var(--lime);
  color: var(--slate-900);
}

.percentageInput input[type="number"]:focus + .percentageSymbol {
  background-color: var(--lime);
  color: var(--slate-900);
}

.mortgageInput:has(input[type="number"]:focus) {
    border: 1px solid var(--lime);
}

.percentageInput:has(input[type="number"]:focus) {
    border: 1px solid var(--lime);
}

.optionContainer {
    display: flex;
    flex-direction: row;
    border: 1px solid var(--slate-500);
    cursor: pointer;
    margin-bottom: 15px;
    border-radius: 8px;
}

.optionContainer p {
    color: var(--slate-900);
    font-weight: 700;
    margin-left: 15px;
}

input[type="radio"] {
    margin-left: 15px;
    accent-color: var(--lime);
    transform: scale(1.2);
    cursor: pointer;
}

.optionContainer:has(input[type="radio"]:checked) {
    background-color: var(--light-lime);
    border: 2px solid var(--lime);
}

.errorMessage {
    margin-top: 10px;
    color: var(--red);
    font-weight: 500;
}

@media (max-width: 1070px) {
    .mainContainer {
        flex-direction: column;
        margin-top: 75px;
        margin-bottom: 75px;
    }

    .ResultsContainer {
        width: 570px;
        height: 550px;
        border-bottom-left-radius: 8px;
        border-top-right-radius: 0px;
    }
}

@media (max-width: 750px) {
    html, body {
        background-color: var(--white);
    }

    .mainContainer {
        margin-top: 0px;
        margin-bottom: 0px;
        box-shadow: 0 0 0;
        border-top-left-radius: 0;
        border-top-right-radius: 0;
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;
    }


    .calculatorContainer {
        width: 87.5%;
    }

    .ResultsContainer {
        width: 100%;
        border-top-left-radius: 0;
        border-top-right-radius: 0;
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;
    }
}