/* common styles */

:root {
    --soft-cyan: hsl(174, 77%, 80%);
    --strong-cyan: hsl(174, 86%, 45%);
    --thumb-active: #329F90;
    --discount-bg: hsl(14, 92%, 95%);
    --discount-text: hsl(15, 100%, 70%);
    --cta-pale-blue: hsl(226, 100%, 87%);

    --white: hsl(0, 0%, 100%);
    --main-bg-pale-blue: hsl(230, 100%, 99%);
    --empty-range: hsl(224, 65%, 95%);
    --toggle-bg: hsl(223, 50%, 87%);
    --text-gray-blue: hsl(225, 20%, 60%);
    --cta-dark-blue: hsl(227, 35%, 25%);
    --cta-hover-blue: hsl(227, 35%, 40%);
    --cta-active-blue: hsl(227, 80%, 15%);
}

/* Border box declaration */
html {
    box-sizing: border-box;
}

*, 
*:before, 
*:after {
    box-sizing: inherit;
}

body {
    margin: 0;
    padding: 0;
    font-family: Arial, Geneva, sans-serif;
    font-family: 'Manrope', sans-serif;
    color: var(--text-gray-blue);

    display: flex;
    flex-flow: column nowrap;
    justify-content: center;
    align-items: center;

    background-color: var(--main-bg-pale-blue);
}

html, body {
    height: 100%;
    min-width: 450px;
}

/* end of common styles */

/* body styles */
main {
    margin: 0;
    max-width: 100%;
    width: 1440px;
    height: 800px;

    background-image: url("images/bg-pattern.svg");
    background-repeat: no-repeat;
    display: flex;
    flex-flow: column nowrap;
    align-items: center;
}

.intro-container {
    height : 16rem;

    display: flex;
    flex-flow: column nowrap;
    justify-content: center;
    align-items: center;

    background-image: url("images/pattern-circles.svg");
    background-repeat: no-repeat;
    background-position: center;
}

h2 {
    margin: 1rem 0 0 0;
    font-size: 1.75em;
    color: var(--cta-dark-blue);
}

.intro-container p {
    font-size: 15px;
}

.pricing-container {
    width: 34rem;
    min-height: 25rem;
    background-color: var(--white);
    border-radius: 3%;
    box-shadow: 0px 10px 20px rgba(0, 0, 0, .05);

    display: flex;
    flex-flow: column nowrap;
    justify-content: space-between;
}

.range-container {
    display: flex;
    flex-flow: row wrap;
    justify-content: space-between;

    flex: 1 1 auto;
}

.range-container > div:first-child {
    display: flex;
    flex-flow: column nowrap;
    justify-content: center;
    align-items: center;

    margin-left: 10%;

    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.range-container > div:nth-child(2) {
    display: flex;
    flex-flow: column nowrap;
    justify-content: center;
    align-items: center;

    margin-right: 10%;
}

.range-container > p {
    display: inline-block;
    vertical-align: middle;

    padding: .5rem;
    height: 5em;
}

.range-container p span{
    display: inline-block;
    vertical-align: middle;

    padding: .5rem;
    color: var(--cta-dark-blue);

    font-size: 2.5em;
    font-weight: 800;
}

.range-container__range {
    display: flex;
    flex-flow: row nowrap;
    justify-content: center;
    align-items: center;

    flex-grow: 1;
}

/* check out  */
/* https://www.w3schools.com/howto/howto_js_rangeslider.asp */

#range {
    width: 80%;
    -webkit-appearance: none;  /* Override default CSS styles */
    appearance: none;

    height: 8px; /* Specified height */
    border-radius: 5px;
    background: linear-gradient(to right, var(--soft-cyan) 0%, var(--soft-cyan) 50%, var(--empty-range) 50%, var(--empty-range) 100%); /* Grey background */
    outline: none; /* Remove outline */
    opacity: 0.7; /* Set transparency (for mouse-over effects on hover) */

    touch-action: none;
}

#range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 50%;

    background: url('images/icon-slider.svg');
    background-repeat: no-repeat;
    background-position: center;
    background-color: var(--strong-cyan);

    cursor: pointer;
}

#range::-webkit-slider-thumb:active {
    cursor: grabbing;
    background-color: var(--thumb-active);
}

#range::-moz-range-thumb {
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 50%;

    background: url('images/icon-slider.svg');
    background-repeat: no-repeat;
    cursor: pointer;
}

#range::-moz-range-thumb:active {
    cursor: grabbing;
    background-color: var(--thumb-active);
}

.range-container__billing {
    padding: 0 4.5rem 0 9rem;
    display: flex;
    flex-flow: row nowrap;
    justify-content: space-around;
    align-items: center;

    flex-grow: 1;
}

.range-container__billing p {
    display: inline-block;
    font-size: .75em;
    vertical-align: middle;
}

#discount > span{
    padding: .25em .5em;
    border-radius: 10px;

    font-size: .75em;
    font-weight: 800;

    color: var(--discount-text);
    background-color: var(--discount-bg);
}

#discount .short-dct {
    display: none;
}


.range-container__switch {
    height: 26px;
}

.range-container__switch label {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

[type="checkbox"] {
    width: 0;
    height: 0;
    inset: 0;
}

.toggle {
    position: relative;
    width: 40px;
    height: 20px;
    border-radius: 15px;
    background-color: var(--toggle-bg);
    transition: all 0.3s;

    cursor: pointer;
}

.toggle::before,
.toggle::after {
    content: "";
    position: absolute;
}

.toggle::before {
    left: 4px;
    top: 3px;
    width: 14px;
    height: 14px;
    background: var(--white);
    border-radius: 50%;;
    z-index: 1;
    transition: transform 0.3s;
}

[type="checkbox"]:checked + span {
    background-color: var(--strong-cyan);
}

[type="checkbox"]:checked + span::before {
    transform: translateX(18px)
}

.button-container {
    height: 8rem;

    display: flex;
    flex-flow: row nowrap;
    justify-content: space-between;

    border-top: 1px;
    border-top-color: #F2F1F6;
    border-top-style: solid ;
}

.button-container ul {
    width: 50%;
    display: flex;
    flex-flow: column nowrap;
    justify-content: center;

    font-size: .75em;
}

ul li {
    padding: 4px;
    list-style-image: url('/images/icon-check.svg');
}

.button-container div {
    width: 50%;
    display: flex;
    flex-flow: column nowrap;
    justify-content: center;
    align-items: center;
}

button {
    padding: .75rem 3rem;
    border: none;
    border-radius: 2em;

    text-decoration: none;

    color: var(--cta-pale-blue);
    background-color: var(--cta-dark-blue);
    transition: all .2s;
}

button:focus {
    outline: 0;
}

button:hover {
    background-color: var(--cta-hover-blue);
    transition: all .2s;
}

button:active {
    background-color: var(--cta-active-blue);
    transition: all .2s;
}

/* end of body styles */

/* media queries */
/* TODO: next time do mobile first */

@media all and (max-width: 1439px) {

    main {
        width: 100%;
        height: 100%;
    }

    .pricing-container {
        max-width: 90%;
    }
}

@media all and (max-width: 600px) {

    h2 {
        font-size: 1.5em;
    }

    .intro-container p {
        text-align: center;
    }

    .intro-container p span {
        display: block;
        padding-top: 5px;
    }

    .pricing-container {
        width: 80%;
    }

    .button-container {
        height: 250px;

        flex-flow: column;
        justify-content: space-evenly;
        align-items: center;
    }

    .button-container ul {
        width: auto;
        margin: 0;
        font-size: .9em;
    }

    button {
        width: 220px;
        height: 50px;

        font-size: 1em;
    }

    .range-container {
        flex-flow: column nowrap;
        min-height: 270px;
    }

    .range-container__range{
        order: 1;
    }

    .range-container > div {
        font-size: 12px;
        flex-grow: 1;
    }

    .range-container > div:first-child {
        margin-left: 0;
    }
    .range-container > p {
        padding: 1rem;
        text-align: center;
    }

    .range-container > div:nth-child(2) {
        order: 2;
    }

    .range-container__billing {
        padding: 0 0 0 3rem;

        order: 3;
    }

    .range-container__billing > p {
        font-size: 12px;
    }

    #discount > span {
        padding: .25em .75em;
    }

    #discount .short-dct {
        display: inline-block;
    }

    #discount .full-dct {
        display: none;
    }

    .button-container {
        height: 200px;
    }

    button {
        padding: 0;
        width: 170px;
        height: 40px;

        font-size: 14px;
    }
}