:root {
    --invoice-error-bg-color: #ffeded;
    --invoice-normal-bg-color: #fff;
    --invoice-loaded-bg-color: #009ca610;
    --primary-color: #009ca6;
    --primary-border-color: #009ca6;
    --primary-bg-color: #fff;
    --btn-color: #fff;
}

html {
    font-size: 14px;
    margin: 0;
    position: relative;
    height: 100%;
    min-height: 100%;
    color: #464646;
}

body {
    margin: 0;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    background-color: #fafafa;
    display: flex;
    flex-direction: column;
}

html, body {
    height: 100%;
}

@media (max-width: 576px) {
    body {
        height: auto;
    }
}

@media (min-width: 576px) {
    .container, .container-sm {
        max-width: inherit;
    }
}

@media (min-width: 1200px) {
    .container {
        max-width: 1170px;
    }
}

.page-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

header {
    background-image: linear-gradient(#ffffff, #fafafa);
}

    header .container {
        border-bottom: 0px solid #e5e5e6;
        display: flex;
        justify-content: space-between;
        padding-right: 15px;
        padding-left: 15px;
        margin-right: auto;
        margin-left: auto;
    }

    header .headerItem {
        display: flex;
    }

    header .mbcLogo {
        text-align: left;
        margin-top: 12px;
        justify-content: flex-start;
    }

    header .banner {
        width: 255px;
        height: 40px;
        background-image: url("/images/banner.png");
        background-repeat: no-repeat;
        background-position: right top;
        color: #ffffff;
        font-size: 18px;
        padding-right: 20px;
        padding-top: 10px;
        text-align: right;
        margin-top: 10px;
    }

@media (max-width: 500px) {
    header .banner {
        width: 100%;
        text-align: center;
        background-image: none;
        color: var(--primary-color);
        font-size: 120%;
        font-weight: bold;
        display: inline-block;
    }
}

@media (max-width: 400px) {
    header .container {
        flex-direction: column;
        align-items: center;
        padding: 0 0;
    }

    header .banner {
        width: 100%;
        text-align: center;
        background-image: none;
        color: var(--primary-color);
        font-size: 120%;
        font-weight: bold;
        display: inline-block;
        padding-right: 0px;
        padding-top: 0px;
    }
}

@media (max-width: 991px) {
    main {
        overflow: unset;
        padding-top: 20px;
    }
}

@media (max-width: 400px) {
    main {
        padding: 0;
    }

        main .card .card-heading {
            font-size: 15px;
        }
}

footer {
    background-color: #ffffff;
    border-top: 1px solid #e5e5e6;
}

    footer .container {
        padding: 20px 10px;
        display: flex;
        flex-direction: row;
        justify-content: space-between;
    }

    footer .footerSection {
        display: grid;
        grid-template-columns: 1fr;
        grid-template-rows: repeat(5, minmax(min-content, max-content));
    }

        footer .footerSection div {
            display: grid;
            grid-template-columns: 25px auto;
        }

            footer .footerSection div:not(:has(img)) p {
                grid-column: 2 / 2;
            }

        footer .footerSection a,
        footer .footerSection p.mobile {
            font-size: 120%;
        }

        footer .footerSection img.imageMobile {
            padding-top: 4px;
        }

        footer .footerSection img.imageEmail {
            padding-top: 2px;
        }

        footer .footerSection img.imageBuilding {
            padding-top: 0px;
        }

        footer .footerSection p {
            font-size: 75%;
            margin-bottom: 0px;
        }

@media (max-width: 576px) {
    footer .container {
        padding: 20px;
        display: flex;
        gap: 1rem;
        flex-wrap: wrap;
    }

    footer .footerSection p.empty {
        display: none;
    }
}

.pageHeading {
    margin-bottom: 30px;
}

@media (max-width: 400px) {
    .pageHeading {
        margin-bottom: 0px;
    }
}

a {
    color: var(--primary-color);
}

p.lead {
    text-align: center;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    font-size: 1.15rem;
}

@media (max-width: 576px) {
    p.lead {
        display: none;
    }
}

@media (min-width: 768px) {
    p.lead {
        font-size: 1.4rem;
    }
}

em {
    color: var(--primary-color);
    font-style: normal;
}

.text-bold {
    font-weight: bold;
}

#paymentForm {
    /*    display: flex;
    flex-direction: row;*/
}

@media (max-width: 550px) {
    #paymentForm {
        flex-direction: column;
    }
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    border-bottom: 2px solid #464646;
}

    .btn-primary[disabled] {
        background-color: #6c757d;
        border-color: #6c757d;
        opacity: .65;
    }

.main div.row div.col {
    padding-right: 15px;
    padding-left: 15px;
}

#refreshBtn {
    margin-left: 10px;
}

@media (max-width: 360px) {
    #refreshBtn {
        margin-left: 0px;
    }
}

#buttonBar {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 5px;
}

#payButtonPanel {
    display: grid;
    grid-template-columns: 1fr auto;
}

.right {
    display: flex;
    justify-content: flex-end;
}

span.text-start {
    padding-left: 0.75rem;
}

span.text-end {
    padding-right: 0.75rem;
}

span.invoiceTotal {
    font-size: 1.1rem;
    padding: 0.25rem 0.8rem;
}

ol {
    list-style-type: none;
    margin-bottom: 0;
    padding-left: 0;
}

    ol hr {
        display: none;
    }

li:has(.invoice) {
    margin-left: -5px;
    margin-right: -5px;
}

li.focus-border {
    border-style: solid;
    border-width: 1px;
    border-color: var(--primary-border-color);
}

.invoice {
    display: grid;
    grid-template-columns: 2fr 1.5fr 0.5fr 1.5fr 0.5fr 0.29fr;
    gap: 5px;
    align-items: center;
    padding: 5px;
}

.has-error {
    background-color: var(--invoice-error-bg-color) !important;
}

.loaded {
    background-color: var(--invoice-loaded-bg-color) !important;
}

/* When the date field is autofilled this rule is applied
    
input:-internal-autofill-selected {s ñ
    background-color: rgb(232, 240, 254) !important;
    background-image: none !important;
    color: -internal-light-dark-color(black, white) !important;
} 

The next rule will counteract it
*/
input:-webkit-autofill,
input:-webkit-autofill:focus {
    transition: background-color 0s 600000s, color 0s 600000s !important;
}

@media screen and (max-width: 576px) {
    .invoice {
        display: grid;
        grid-template-columns: 1.5fr 1fr 0.5fr;
        align-items: end;
        justify-items: end;
    }

        .invoice div::before {
            content: attr(data-label);
            float: left;
            font-weight: bold;
        }

    .invoiceHeader {
        display: none;
    }

    .invoiceTotal {
        grid-column: 1 / 4;
    }

    ol hr {
        display: block;
        background-color: dimgrey !important;
        color: dimgrey !important;
        border: solid 2px dimgrey !important;
        height: 5px !important;
    }
}

@media screen and (max-width: 400px) {
    .invoice {
        display: flow;
        justify-items: normal;
    }

    .invoiceElement {
        margin-bottom: 0.6rem;
    }

        .invoiceElement:has(input[type=button]) {
            display: flex;
            justify-content: flex-end;
        }

    .invoiceHeader {
        display: none;
    }

    .invoiceTotal {
        display: flex;
        justify-content: flex-end;
        padding-right: 0.75rem;
    }
}

@media (max-width: 500px) {
    .buttonContainer {
        flex-direction: column;
        align-items: center;
    }

        .buttonContainer > div {
            width: 100%;
            text-align: center;
        }
}

.errorMsg {
    color: red;
    font-size: 0.9em;
}

.swal-wide {
    width: 100%;
    max-width: 600px; /* ideal width on desktop */
    box-sizing: border-box;
}

h2.swal2-title.swal-title-custom {
    background-color: var(--primary-color);
    color: #ffffff;
    font-size: 18px;
    font-weight: normal;
    padding: 4px 10px;
    text-align: left;
}

.swal-html-custom {
    padding: 1rem 1rem 0 1rem;
}

    .swal-html-custom div label {
        display: block;
        font-size: 14px;
    }

    .swal-html-custom div .swal2-input {
        padding: .375rem .75rem;
        font-size: 1rem;
        font-weight: 400;
        margin: 10px 0px;
        width: 100% !important;
    }

.swal2-actions {
    justify-content: center;
    width: 100%;
}

.swal-btn-custom {
    margin: 0px 15px;
}

.swal-email-container {
    text-align: left;
}

.swal-email-wrapper {
    position: relative;
    width: 100%;
}

.swal-email-input {
    width: 100%;
    padding-right: 2.5em;
}

.swal-email-error {
    color: red;
    font-size: 0.9em;
    display: none;
    text-align: left;
    margin-top: 0.5em;
}

#clearEmail {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    border: solid 0px black;
    background: transparent;
    font-size: 1.25em;
    color: #888;
    cursor: pointer;
    line-height: 1;
}

@media (max-width: 640px) {
    .swal-wide {
        max-width: 90vw; /* scale down on tablets/phones */
        padding: 1rem;
    }

    .swal-title-custom {
        font-size: 1.25rem;
        white-space: normal; /* allow wrapping if needed on very small screens */
        text-overflow: initial;
    }
}
