* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: hsl(203, 41%, 72%);
    font-family: "Plus Jakarta Sans";
}

.main {
    margin: 10% auto 10% auto;
    display: flex;
    flex-direction: row;
    max-width: 1440px;
    width: 65%;
    height: 100%;
    background-color: hsl(0, 0%, 100%);
    border-radius: 12px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.calculator {
    display: flex;
    flex-wrap: wrap;
    flex-direction: column;
    margin: 2%;
    padding: 10px;
    width: 50%;
}

.title {
    margin: 2% 0% 2% 0%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.title label {
    padding: 0;
    font-size: 15px;
    color: hsl(200, 24%, 40%);
    text-decoration: underline;
    cursor: pointer;
}

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

.formgroup1 {
    display: flex;
    flex-direction: column;
    margin: 2% 0% 2% 0%;
}

.inputgroup1.error span,
.inputgroup2.error span {
    background-color: #ff0000;
    color: hsl(0, 0%, 100%);
}

.error-message {
    color: #ff0000;
    font-size: 0.875em;
    margin-top: 0.25em;
}

.inputgroup1.error,
.inputgroup2.error {
    border: 1px solid #ff0000;
}

.inputgroup3 .active {
    background-color: limegreen;
}

.inputgroup1 {
    border: hsl(200, 24%, 40%) solid 1px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    border-radius: 5px;
    margin-top: 5px;
}

.inputgroup1 span {
    padding: 10px;
    background-color: hsl(202, 86%, 94%);
    color: hsl(202, 55%, 16%);
    border-top-left-radius: 4px;
    border-bottom-left-radius: 4px;
}

.inputgroup1 input {
    border: none;
    outline: none;
    font-size: 20px;
    font-weight: 550;
    padding-left: 10px;
    background-color: transparent;
    width: 100%;
}

.formgroup2 {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    margin: 2% 0% 2% 0%;
}

.inputgroup2 {
    border: hsl(200, 24%, 40%) solid 1px;
    display: flex;
    align-items: center;
    border-radius: 5px;
    width: 100%;
    margin-top: 5px;
}

.inputgroup2 span {
    padding: 10px;
    background-color: hsl(202, 86%, 94%);
    color: hsl(202, 55%, 16%);
    border-top-right-radius: 4px;
    border-bottom-right-radius: 4px;
}

.inputgroup2 input {
    border: none;
    outline: none;
    font-size: 20px;
    font-weight: 550;
    width: 100%;
    padding-left: 10px;
    background-color: transparent;
}

.formgroup3 {
    display: flex;
    flex-direction: column;
    margin: 2% 0% 2% 0%;
}

.inputgroup3 {
    position: relative;
}

.inputgroup3 input {
    opacity: 0%;
}

.inputgroup3 label {
    padding: 15px;
    border: 1px solid hsl(200, 24%, 40%);
    border-radius: 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: start;
    width: 100%;
    font-weight: 700;
    box-sizing: border-box;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.inputgroup3 label:before {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-right: 10px;
    border: 2px solid #ddd;
    border-radius: 50%;
    background-color: white;
    box-sizing: border-box;
    transition: border-color 0.3s ease, background-color 0.3s ease;
}

.inputgroup1:focus-within,
.inputgroup2:focus-within {
    border-color: hsl(61, 70%, 52%);
    transition: border-color 0.3s ease-in-out;
}

.inputgroup1:focus-within span,
.inputgroup2:focus-within span {
    background-color: hsl(61, 70%, 52%);
    transition: background-color 0.3s ease-in-out;
}

.inputgroup3 label.active {
    background-color: hsl(61, 67%, 75%);
    border-color: hsl(61, 70%, 52%);
}

.inputgroup3 label.active:before {
    border-color: hsl(61, 70%, 52%);
    background-color: hsl(61, 70%, 52%);
}

.button_style {
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 20px;
    padding: 10px 30px 10px 30px;
    width: auto;
    margin: 2% auto 5% 0;
    color: hsl(202, 55%, 16%);
    background-color: hsl(61, 70%, 52%);
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.button_style:hover {
    background-color: hsl(61, 78%, 63%);
}

.result_container {
    background-color: hsl(202, 55%, 16%);
    display: flex;
    flex-direction: column;
    padding: 10px;
    width: 50%;
    color: hsl(0, 0%, 100%);
    border-radius: 12px;
    border-top-left-radius: 0;
    border-bottom-left-radius: 50px;
}

.result,
.empty_result {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: hsl(0, 0%, 100%);
    border-radius: 12px;
    border-top-left-radius: 0;
    border-bottom-left-radius: 50px;
}

.empty_result img {
    margin-top: 15%;
    width: 40%;
    height: 40%;
}

.empty_result h2 {
    align-self: center;
    margin-bottom: 10px;
}

.empty_result p {
    margin: 0;
    padding: 0;
}

.result h2 {
    align-self: start;
    margin-bottom: 10px;
}

.result p,
.empty_result p {
    font-size: 16px;
    font-weight: 100;
}

.calculator_result {
    background-color: hsl(200, 50%, 12%);
    border-radius: 10px;
    border-top: hsl(61, 70%, 52%) solid 4px;
    margin-top: 40px;
    width: 100%;
    padding: 30px;
    overflow-y: auto;
}

.monthly_repayments {
    border-bottom: hsl(202, 86%, 94%) solid 1px;
    padding-bottom: 15px;
}

.monthly_repayments span {
    color: hsl(61, 70%, 52%);
    font-size: 60px;
    font-weight: 700;
}

.total_term p,
.monthly_repayments p {
    font-size: 15px;
    margin-bottom: 10px;
}

.total_term {
    padding-top: 15px;
}

.total_term span {
    font-size: 30px;
    font-weight: 700;
}

input:focus {
    .formgroup1 {
        border-color: hsl(61, 70%, 52%);
    }
}

@media (max-width: 375px) {
    .main {
        width: 100%;
    }

    .main,
    .title,
    .formgroup2 {
        flex-direction: column;
    }

    .title {
        align-items: start;
    }

    .calculator {
        width: auto;
    }

    .button_style {
        width: 100%;
    }

    .result_container {
        width: auto;
        border-radius: 0;
    }
}