@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;800&display=swap');

:root {
    --purple: hsl(259, 100%, 65%);
    --light-red: hsl(0, 100%, 67%);
    --white: hsl(0, 0%, 100%);
    --off-white: hsl(0, 0%, 94%);
    --light-grey: hsl(0, 0%, 86%);
    --smokey-grey: hsl(0, 1%, 44%);
    --off-black: hsl(0, 0%, 8%);
}

* {
    font-family: "Poppins", sans-serif;
    box-sizing: border-box;
    padding: 0;
    margin: 0;
}

body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--light-grey);
}

.calculator-card {
    background-color: var(--white);
    width: 600px;
    border-radius: 1rem 1rem 10rem 1rem;
}

.calculator-container {
    padding: 2rem;
    display: flex;
    flex-direction: column;
}

form {
    display: flex;
    flex-direction: column;
}

.date-inputs {
    display: flex;
    gap: 1rem;
}

.date-field {
    display: flex;
    flex-direction: column;
}

.date-field label {
    text-transform: uppercase;
    font-weight: 600;
}

input {
    width: 100px;
    padding: 0.5rem;
    border-radius: 0.5rem;
    border: 1px solid var(--light-grey);
    font-size: 1.5rem;
}

input::placeholder {
    font-size: 1.5rem;
    font-weight: 800;
}

.submit-area {
    display: flex;
    align-items: center;
}

.submit-area hr {
    width: 100%;
}

.calculate-btn {
    border-radius: 50%;
    padding: 1rem;
    background-color: var(--purple);
    border: none;
    cursor: pointer;
}

.calculate-btn:active {
    background-color: var(--off-black);
}

.age-output h1 {
    font-size: 5rem;
    font-weight: 800;
    font-style: italic;
}

.age-output span {
    color: var(--purple);
}

small {
    color: red;
}

@media screen and (max-width: 600px) {
    .calculator-card {
        width: 360px;
    }
    
    .calculator-container {
        padding: 1rem;
    }

    .date-inputs {
        margin-bottom: 5rem;
        gap: 0;
        justify-content: space-between;
    }

    .submit-area {
        position: relative;
    }

    .calculate-btn {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
    }

    .age-output {
        margin-top: 5rem;
    }

    .age-output h1 {
        font-size: 3.5rem;
    }
}
