:root {
    --number: 1;
}

nav {
    background-color: var(--blue-700);
    color: var(--white)
}

nav a img{
    filter: invert(100%) sepia(0%) saturate(0%) hue-rotate(119deg) brightness(103%) contrast(102%);
}

main {
    min-height: calc(100vh - 200px);
    padding: 2rem;

    display: grid;
    gap: 2rem;
}

main > img {
    max-width: 500px;
}

header, form {
    max-width: 1000px;
    justify-self: center;
}

header {
    text-align: center;

    display: flex;
    flex-direction: column;
    align-items: center;
}

header span {
    letter-spacing: 2px;
}

header > div {
    margin-top: 2rem;

    display: flex;
    align-items: center;
    gap: 5px;
}

header > div div {
    width: 10px;
    height: 10px;
    border-radius: 100%;
    background-color: var(--gray-500);
}

header > div hr {
    width: 150px;
    height: 2px;
}

form {
    width: 100%;
    
    display: grid;
    grid-template-columns: 40% 50%;
    justify-content: center;
    gap: 1rem;
}

form h2 {
    grid-area: 1 / 1 / 1 / -1;
}

form input[type="radio"],
form input[type="checkbox"] {
    width: fit-content !important;
}

form div[data-payment="credit"],
form div[data-payment="debit"],
form div[data-payment="ticket"],
form div[data-payment="pix"],
form div[data-payment="address"],
form div[data-payment="address-flex"],
form div[data-payment="debit-flex"] {
    display: none;
}

form.credit div[data-payment="credit"],
form.debit div[data-payment="debit"],
form.ticket div[data-payment="ticket"],
form.pix div[data-payment="pix"],
form.address div[data-payment="address"] {
    display: block;
}

form.address div[data-payment="address-flex"],
form.debit div[data-payment="debit-flex"] {
    display: flex;
}

form .line {
    grid-area: var(--number) / 1 / var(--number) / -1;
}

form .field {
    position: relative;
}

form .field label {
    font-weight: 600;
}

form .field input,
form .field select {
    width: 100%;
    margin-top: 0.5rem;
    padding: 0.5rem;
    border-radius: 10px;
    border: none;
    background-color: var(--gray-400);
}

form .field span {
    color: var(--gray-500);
    font-size: 0.8rem;
}

form .field img#togglePassword {
    display: block;
    width: 1rem;
    cursor: pointer;
    filter: invert(27%) sepia(0%) saturate(1637%) hue-rotate(170deg) brightness(102%) contrast(75%);

    position: absolute;
    top: 2.3rem;
    right: 13px;
}

form .field img {
    display: none;
}

form .field .bank img { 
    display: block;
    height: 60px;
    transform: scale(0.8);

    transition: filter 0.3s ease-in-out;
}

form .field .bank input { 
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}
  
form .field .bank input + img {
    cursor: pointer;
    filter: brightness(1.2) saturate(0) opacity(0.8);
}
  
form .field .bank input:checked + img {
    filter: none;
}

form .container {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

form .container img {
    width: fit-content;
    height: fit-content;
    transform: scale(0.7) translate(-20%, 45%)
}

form .container.address .field{
    width: 100%;
}

form button {
    width: 300px;
    color: var(--white);
    background-color: var(--purple-500);
    border-radius: 10px;
    border: none;
    margin-top: 2rem;
    padding: 0.5rem 1rem;
    text-transform: uppercase;
    font-weight: 700;

    justify-self: end;
}

.confetti {
    position: absolute;
    top: 50vh;
}
 
@media screen and (max-width: 768px) {
    form {
        grid-template-columns: 1fr;
    }

    form .line {
        grid-area: auto;
    }

    header > div hr {
        width: 100px;
    }

    form button {
        width: auto;
    }

    form .container {
        flex-direction: column;
    }

    form .container#flags {
        display: none;
     }

    form .field img {
        display: block;
    }

    form .hide {
        display: none !important;
    }
}

