:root {
    /* Colors */

    /* Primary */
    --customFullSliderBar: hsl(174, 77%, 80%);
    --customSliderBackround: hsl(174, 86%, 45%);
    --customDiscountBackground: hsl(14, 92%, 95%);
    --customDiscountText: hsl(15, 100%, 70%);
    --customCTAText: hsl(226, 100%, 87%);

    /* Neutral */
    --customPricingComponentBackground: hsl (0, 0%, 100%);
    --customMainBackground: hsl(230, 100%, 99%);
    --customEmptySliderBar: hsl(224, 65%, 95%);
    --customToggleBackground: hsl(223, 50%, 87%);
    --customText: hsl(225, 20%, 60%);
    --customTextCTABackground: hsl(227, 35%, 25%);

    /* Weight */
    --bold: 600;
    --bolder: 800;

    /* Font size */
    --size: 15px;

    /* padding */
    --spacing: 2rem;
}

* {
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    -moz-appearance: none;
    appearance: none;
}


body {
    font-family: Manrope, sans-serif;
    font-size: var(--size);

    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    align-items: center;

    color: var(--customText);
    background: var(--customMainBackground) url("images/bg-pattern.svg") top left no-repeat;
}


header {
    animation: header-appear 600ms ease-in-out;

    padding-block: calc(var(--spacing)*2);
    text-align: center;
    background: url("images/pattern-circles.svg") center no-repeat;
}
header h1 {
    font-weight: var(--bolder);
    margin-block: calc(var(--spacing)*0.3);
    color: black;
}


main {
    animation: main-appear 600ms ease-in-out;

    max-width: 98vw;
    display: flex;
    flex-direction: column;

    border-radius: 8px;
    background-color: white;
    box-shadow: rgba(0, 0, 0, 0.1) 0px 10px 15px -3px, rgba(0, 0, 0, 0.05) 0px 4px 6px -2px;
}


.section_top {
    padding: var(--spacing);
    margin-bottom: var(--spacing);
}
.section_top .first_div {
    display: grid;
    place-items: center;
}
.section_top .first_div span {
    font-weight: var(--bolder);
    text-transform: uppercase;
    letter-spacing: 2px;
    
}
.section_top .first_div input {
    width: 100%;
    &:active { cursor: pointer; }
}
.section_top .first_div label {
    display: flex;
    align-items: center;
    font-weight: var(--bold);
}
.section_top .first_div label strong {
    font-size: calc(var(--size)*3);
    color: black;
}


.section_top .second_div {
    font-size: calc(var(--size)*0.85);
    margin-block-start: var(--spacing);
    display: flex;
    justify-content: end;
    gap: 0.5rem;
}
.section_top .second_div  .discount::after {
    color: var(--customDiscountText);
    background-color: var(--customDiscountBackground);
    border-radius: 20px;
    padding-inline: 5px;
    margin-inline-start: 5px;
}


.section_bottom {
    padding: var(--spacing);
    border-top: 1px solid rgba(0, 0, 0, 0.1);

    display: flex;
    justify-content: space-between;
    align-items: center;
}
.section_bottom ul {
    list-style-position: inside;
    list-style-image: url("images/icon-check.svg");
}
.section_bottom button {
    height: 40px;
    width: fit-content;
    padding-inline: 2.5rem;
    border-radius: 50px;
    border: none;
    font-weight: var(--bold);
    color: var(--customCTAText);
    background-color: var(--customTextCTABackground);
}
.section_bottom button:hover {
    color: white;
    cursor: pointer;
}
.section_bottom button:active {
    opacity: 0.8;
}


/* *************MEDIA QUERIES************* */

@media screen and (max-width: 480px) {
    main {
        width: 98vw;
    }
    header h1 {
        font-size: calc(var(--size)*1.2);
    }
    header p {
        font-size: calc(var(--size)*0.8);
    }

    .section_top {
        padding: calc(var(--spacing)*0.5);
    }
    .section_top .first_div {
        grid-template-rows: 1fr 1fr 1fr;
        row-gap: calc(var(--spacing)*0.75);
    }
    .section_top .first_div span {
        grid-row: 1;
    }
    .section_top .first_div label {
        grid-row: 3;
    }
    .section_top .first_div input {
        grid-row: 2;
    }

    .section_top .second_div  .discount::after {
        content: "-25%";
    }
    .section_bottom {
        flex-direction: column;
        gap: var(--spacing);
    }
}
@media screen and (min-width: 480px) {
    .section_top .first_div {
        grid-template-rows: 1fr 1fr;
        grid-template-columns: 1fr 1fr;
        row-gap: calc(var(--spacing)*0.5);
        column-gap: var(--spacing);
    }
    .section_top .first_div span {
        grid-row: 1;
        grid-column: 1/2;
    }
    .section_top .first_div label {
        grid-row: 1;
        grid-column: 2/3;
    }
    .section_top .first_div input {
        grid-row: 2;
        grid-column: 1/3;
    }

    .section_top .second_div  .discount::after {
        content: "25% discount";
    }
}


.attribution { font-size: 11px; text-align: center; margin-top: calc(var(--spacing)*2);}
.attribution a { color: hsl(228, 45%, 44%); }



/* **********INPUTS STYLING************* */

#bill {
    &::-webkit-slider-runnable-track {
        height: 10px;
        background-color: var(--customEmptySliderBar);
        border-radius: 20px;
    }
    &::-moz-range-track {
        height: 10px;
        background-color: var(--customEmptySliderBar);
        border-radius: 20px;
    }

    &::-webkit-slider-thumb {
        -webkit-appearance: none;
        appearance: none;
        border: none;
        margin-top: -15px;
        background: var(--customSliderBackround) url("images/icon-slider.svg") center no-repeat;
        border-radius: 50%;
        height: 40px;
        width: 40px;
        cursor: pointer;
        box-shadow: hsla(174, 86%, 45%, 0.50) 0px 54px 55px, hsla(174, 86%, 45%, 0.24) 0px -12px 30px, hsla(174, 86%, 45%, 0.24) 0px 4px 6px, hsla(174, 86%, 45%, 0.34) 0px 12px 13px, hsla(174, 86%, 45%, 0.18) 0px -3px 5px;
    }
    &::-moz-range-thumb {
        -moz-appearance: none;
        appearance: none;
        border: none;
        height: 40px;
        width: 40px;
        background: var(--customSliderBackround) url("images/icon-slider.svg") center no-repeat;
        border-radius: 50%;
        cursor: pointer;
        box-shadow: hsla(174, 86%, 45%, 0.50) 0px 54px 55px, hsla(174, 86%, 45%, 0.24) 0px -12px 30px, hsla(174, 86%, 45%, 0.24) 0px 4px 6px, hsla(174, 86%, 45%, 0.34) 0px 12px 13px, hsla(174, 86%, 45%, 0.18) 0px -3px 5px;    }
}

.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.slider::before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

#mySwitch:checked + .slider {
    background-color: var(--customSliderBackround);
}

#mySwitch:checked + .slider::before {
    transform: translateX(20px);
}

/*********KEYFRAMES********/
@keyframes header-appear {
    from {
        transform: translateY(-30%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}
@keyframes main-appear {
    from {
        transform: translateY(30%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}