:root {
    --white: #fff;
    --main-text-color: #2b323b;
    --secondary-text-color: rgba(0, 14, 24, 0.59);
    --border-color: rgba(2, 28, 55, 0.08);
    --success-color: rgba(0, 107, 59, 0.91);
    --warning-color: rgba(188, 72, 0, 0.98);
    --animation-spin: spin .8s linear infinite;
}

body {
    margin: 0;
    padding: 0;
    font-family: "Inter", sans-serif;
    font-optical-sizing: auto;
    font-weight: 400;
    font-style: normal;
    font-size: 1rem;
    color: var(--secondary-text-color);
    background-color: #f1f3f5;
}

header {
    padding: 1.25rem 4.5rem;
    background: var(--white);
    border-bottom: 1px solid var(--border-color);

    & h1 {
        margin: 0;
        text-align: center;
        font-size: 1.5rem;
        font-weight: 600;
        overflow: auto;
        color: var(--main-text-color);
    }
}

.loading-overlay {
    position: fixed;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    z-index: 9999;
}

.loading-screen-spinner {
    width: 2.5rem;
    height: auto;
    animation: var(--animation-spin);
}

.fade-target {
    transition: opacity .8s;
}

#post-loading-screen {
    padding: 3rem;
}

.instruction-and-payment-content {
    max-width: 374px;
    margin: 0 auto 1.5rem;
    padding: 1.25rem;
    text-align: center;
    background-color: var(--white);
    border: 1px solid var(--border-color);
    border-radius: .75rem;

    & img.payment-title-icon {
        width: 1.625rem;
        margin: 0 auto;
    }

    & h2 {
        margin: 1.625rem 0 .75rem;
        font-size: 1.25rem;
        font-weight: 600;
        color: var(--main-text-color);
    }

    & p {
        margin: .75rem 0;
    }

     & p.error-server-response {
        margin: 2rem 0;
    }

    & #error-message {
        display: block;
        margin: .75rem 0 0;
        color: var(--warning-color);
    }
}

#pix-qrcode-container,
#boleto-code-container {
    margin: 2rem auto;

    & #qrcode-image {
        display: block;
        margin: 0 auto;
    }

    & .code-text {
        display: block;
        width: 100%;
        margin: .5rem 0 0;
        word-wrap: anywhere;
        font-weight: 600;
        font-size: .75rem;
    }
}

#pix-qrcode-container {
    max-width: 15.25rem;

    & .code-text {
        word-wrap: normal;
        line-break: anywhere;
    }
}

.payment-buttons-container {
    margin-bottom: 2rem;

    & .copy-button-container {
        position: relative;

        & p.copy-success {
            opacity: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            position: absolute;
            top: 100%;
            left: 50%;
            width: 100%;
            margin: .25rem 0 0;
            transform: translateX(-50%);
            font-size: .75rem;
            font-weight: 500;
            color: var(--success-color);

            & img {
                width: 1rem;
                height: auto;
            }
        }
    }
}

#boleto-buttons-container {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    justify-content: center;

    & > div {
        flex: 1;
    }
}

button,
a.button {
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    display: flex;
    flex-grow: 1;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 100%;
    border: none;
    border-radius: .5rem;
    margin: 0;
    padding: .6rem .9rem;
    cursor: pointer;
    font-family: "Inter", sans-serif;
    font-optical-sizing: auto;
    font-style: normal;
    font-size: .875rem;
    font-weight: 600;
    text-decoration: none;
    background: hsla(210, 98.8%, 14.4%, .055);
    color: var(--main-text-color);

    &:hover {
        background: hsla(210, 98.8%, 14.4%, .1);
    }

    & img {
        width: 1.25rem;
        height: auto;
    }

    &.button-ghost {
        background: transparent;
    }

    &.button-ghost:hover {
        box-shadow:0 0 0 .125rem var(--border-color) inset;
    }
}

.countdown-bar {
    width: 100%;
    height: .5rem;
    position: relative;
    z-index: 1;
    border: none;
    border-radius: .25rem;
    -moz-border-radius: .25rem;
    background-color: rgba(2, 28, 55, 0.1);

    & span {
        position: relative;
        z-index: 2;
        display: block;
        height: 100%;
        width: 0;
        min-width: .5rem;
        max-width: 100%;
        border: none;
        border-radius: .25rem;
        -moz-border-radius: .25rem;
        background-color: rgba(2, 28, 55, 0.5);
    }

    & span.warning {
        background-color: var(--warning-color);
    }
}

p.countdown-message {
    margin: 1rem 0 0;
    font-size: .875rem;
    font-weight: 500;
    letter-spacing: -0.5px;
    text-align: left;
    color: var(--secondary-text-color);

    & span.warning {
        color: var(--warning-color);
    }

    & #pix-countdown-message,
    & #boleto-countdown-message {
        display: flex;
        justify-content: center;
        gap: .375rem;
        width: 100%;
    }

    & img.jade-spinner {
        width: 1rem;
        height: auto;
        animation: var(--animation-spin);
    }

    & span.countdown-timer {
        color: var(--main-text-color);
    }

    & span.countdown-timer.warning {
        color: var(--warning-color);
    }
}

.order-information,
.payment-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin: 2rem 0 0;

    & > div {
        flex: calc(50% - .5rem);
        font-size: .875rem;
    }

    & > div:nth-child(odd) {
        text-align: left;
    }

    & > div:nth-child(even) {
        text-align: right;
    }
    
    & > div > a {
        text-align: center;
    }
}

.order-information {
    & > div:nth-child(even) {
        color: var(--main-text-color);
        font-weight: 600;
    }
}

img {
    max-width: 100%;
    height: auto;
}

@keyframes spin {
    0% {
        transform: rotate(0)
    }

    to {
        transform: rotate(360deg)
    }
}