@import url('../fonts/Inter-VariableFont.ttf');

* {
    box-sizing: border-box;
    font-family: "Inter", sans-serif;
    font-optical-sizing: auto;
    font-size: 18px;
    font-weight: 400;
    font-style: normal;
}

html {
    height: 100%;
}

body {
    background: linear-gradient(to bottom, rgb(255 102 0 / 25%), rgb(0 158 224 / 25%)) 0 0 / 100% 100%;
    /* color: #005477; */
}

h1 {
    margin-block: 0 1rem;
    font-size: 28px;
    font-weight: 700;
    color: #005477;

    & span {
        font-size: inherit;
    }
}

h2 {
    margin-top: 3rem;
}

strong {
    font-weight: 600;
}

em {
    font-style: italic;
}

small{
    font-size: 15px;
}

.logo {
    display: block;
    margin: 2rem auto;
    width: min(95vw, 600px);
}

.calculator {

    margin: 2rem auto;
    width: min(95vw, 600px);
    background: #fff;
    border: 1px solid rgb(211, 204, 227);
    border-radius: 1rem;
    padding: 1rem;
    box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);

    & .setSelection {
        display: none;
    }

    &:has(#calculatorFormContainer:empty) .setSelection {

        display: block;

        & #datasetSelect {
            display: block;
            width: 100%;
            border: 1px solid #ccc;

            & option {
                padding: .5rem;
            }
        }
    }


    & #calculatorFormContainer form {
        & section {
            display: none;

            &.active {
                display: block;
                opacity: 1;
                transition: opacity .3s ease-out;

                @starting-style {
                    opacity: 0;
                }
            }
        }


        & label {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
            align-items: start;
            gap: 0 0.75rem;
            margin-bottom: 1rem;

            &:has(.dienstSlider[type="range"]) {
                grid-template-columns: auto max-content max-content;

                & .dienstSlider {
                    grid-column: span 2;
                }

                & .sliderValue {
                    text-align: right;
                }

                & :is(.sliderMinus, .sliderPlus) {
                    text-align: center;
                    background: #efefef;
                    padding-inline: .3rem;
                    border: 1px solid #b2b2b2;

                    &:hover {
                        cursor: pointer;
                        background: #cacaca;
                    }
                }

                & .sliderPlus {
                    grid-column: 3;
                    grid-row: 1;
                    border-radius: 4px 4px 0 0;
                    border-bottom: 0;
                }

                & .sliderMinus {
                    border-radius: 0 0 4px 4px;
                    border-top: 0;
                    border: 1px solid #b2b2b2;
                }
            }

            &:has(.slider[type="range"]) {
                grid-template-columns: 2fr 1em 2fr;
            }

            &:has([type="checkbox"]) {
                grid-template-columns: max-content auto;
                gap: .5em;
            }

            &:has([readonly]) input {
                opacity: 0.3;
                pointer-events: none;
            }

            &>span:has(span.tooltip) {
                position: relative;
                cursor: pointer;

                &:after {
                    content: "";
                    display: inline-block;
                    width: 16px;
                    height: 16px;
                    background: url('../images/info.svg') no-repeat center center;
                }

                & span.tooltip {
                    display: block;
                    position: absolute;
                    top: -.25rem;
                    left: 0;
                    transform: translateX(20%) translateY(-100%);
                    background: #fae5ab;
                    border-radius: 1rem 1rem 1rem 0;
                    font-size: 12px;
                    padding: .5rem 1rem;
                    z-index: 99;
                    pointer-events: none;
                    max-width: 80%;
                    transition: opacity .2s ease-out;

                    opacity: 0;
                }

                &:is(:hover, :focus) span.tooltip {

                    opacity: 1;
                }
            }

            & input:not([type="checkbox"]:not[type="radio"]) {
                width: 100%;
            }

            & input {
                accent-color: #005477;
            }

            & span.date {
                display: grid;
                grid-template-columns: 2fr 2fr 3fr;
                gap: .5rem;
            }

        }

        & input:not([type="range"]),
        select {
            border: 1px solid #ccc;
            border-radius: 4px;
            padding: .2em .4em;
        }

        & input:not([readonly]).error,
        select.error {
            border: 1px solid #f54747;
        }

        & input#berekeningDownloadButton {
            background: #f9f9f9 url(../images/pdf.svg) left+10px center / 40px no-repeat;
            border: 1px solid #ebebeb;
            padding: 1em 1em 1em calc(1em + 50px);
            box-shadow: 1px 1px 3px #dbdbdb;
            cursor: pointer;
            transition: all .2s ease-out;

            &:hover {
                background-color: #ffffff;
            }
        }

        & #calculationHtmlShort td {
            min-width: 40%;
            padding: 0.5rem;

            &:first-child {
                padding-left: 0;
            }
        }

    }

    & .navigation {
        display: flex;
        justify-content: space-between;
        margin-top: 2rem;
        border-radius: .5rem;
        overflow: hidden;
        background: #f5f5f5;

        & button {
            border: 0;
            border-left: 3px solid #fff;
            padding: .5em 1em;
            background: #f5f5f5;
            transition: all .2s ease-out;

            &:first-child {
                border-left: 0;
                border-right: 3px solid #fff;
            }

            &:hover {
                cursor: pointer;
                background: #444444;
                color: #ffffff;
            }
        }
    }

}

.section:has(#berekeningNaam) {
    display: block;

    &:not(.active) {

        #berekeningNaam,
        #berekeningVersie,
        #berekeningDownload,
        .navigation {
            display: none;
        }
    }
}