html {
    box-sizing: border-box;
}

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

h1, h2, h3, h4, h5, h6 { margin: 0;}

html {
    /*background-color: #eee;*/
    font-family: 'Inter', sans-serif;
    line-height: 1.5em;
    font-size: 16px;
    padding: 1em;
    padding-top: 0;
    color: #182389;
    min-height: 100vh;
}

html.dark {
    background-color: #3f3c52;
    color:white;
}

.small {
    font-size: .7em;
    line-height: 1.2em;
    opacity: .8;
}

.mt-s { margin-top: 1em; }
.mt-m { margin-top: 2em; }
.mt-l { margin-top: 3em; }
.mt-xl { margin-top: 4em; }

.mb-s { margin-bottom: 1em; }
.mb-m { margin-bottom: 2em; }
.mb-l { margin-bottom: 3em; }
.mb-xl { margin-bottom: 4em; }

.d-block { display:block; }
.d-inline { display:inline; }
.d-inline-block { display: inline-block; }

.align-center { text-align:center; }
.align-left { text-align:left; }

h2 {
    margin: 0;
    font-size: .8em;
    margin-top: 1em;
    font-weight: 500;
}

p + p {
    margin-top: 1em;
}

a { color: inherit; }

hr {
    border: 0;
    height: 1px;
    width: 60%;
    margin-left: auto;
    margin-right: auto;
    background-color: #182389;
}

html.dark hr {
    background-color: #9897a9;
}

header {
    background: conic-gradient(at 0% 0%, snow, white);
    border-bottom-left-radius: 1rem;
    border-bottom-right-radius: 1rem;
    padding: 1.5rem;
    width: 100%;
    max-width: 70ch;
    margin : 0 auto 0 auto;
    display: flex;
    flex: auto;
    flex-direction: row;
    align-items: center;
}

html.dark header, html.dark section {
    background: #3f3c52;
    color:white;
}

header .logo {
    background: url('../../img/logo.svg');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center center;
    width: 72px;
    height: 72px;
    margin-right: 2em;
    flex-shrink: 0;
}

main, footer {
    width: 100%;
    max-width: 70ch;
    margin : 0 auto;
}

input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

section {
    background-color: white;
    border-radius: 1rem;
    padding: 1.5rem 0.5rem;
}

section#intro {
    background : conic-gradient(from 90deg at bottom right, #1f127d, #4567e9);
    color: white;
    padding-bottom: 2.5rem;
    position: sticky;
    top: 0;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

html.dark section#intro {
    background: #1f1d2b;
    color: #9897a9;
}

#intro h3 {
    cursor: pointer;
}

#intro .content {
    padding-top: 1.5rem;
}

section#result {
    /*margin-top: -1rem;*/
    position: relative;
    z-index: 3;
}

#result h4 {
    text-align:center;
    font-size: 1.5em;
    margin-bottom: 1em;
}

#result div + h4 {
    margin-top: 2em;
}

#result input, #result select {
    border: 1px solid;
    display: block;
    width: 100%;
    padding: 10px;
    margin-bottom: 1em;
}

#result input.inline {
    display: inline-block;
    width: auto;
}

input, select {
    background-color: rgba(255,255,255,.8);
    border-radius: 5px;
    padding: 5px;
    border: 0;
    margin: 5px 0;
}

html.dark input, html.dark select, section#scale .result {
    background-color: #3e3b50;
    color:white;
}

/* Specific CSS for OFF inputs */
div[class^="line off_"] {
    display: none;
}

footer {
    padding: 1.5rem;
    font-size: .7rem;
    opacity: .7;
    line-height: 1rem;
    background-color: rgba(24,35,137,.05);
    border-radius: .5em;
}

nav, section.bottom {
    position : fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 70ch;
    /*border-top-left-radius: 1rem;
    border-top-right-radius: 1rem;*/
    background-color: white;
    box-shadow:
      0 0px 1.9px rgba(0, 0, 0, 0.035),
      0 0px 15px rgba(0, 0, 0, 0.07)
    ;
    z-index: 100;
}

section.bottom {
    z-index: 50;
    bottom: 0;
    transform: translate(-50%, 100%);
    transition: all .3s ease-in-out;
    background : conic-gradient(from 90deg at bottom right, #1f127d, #4567e9);
    color: white;
}

html.dark nav, html.dark section.bottom {
    background: #272636;
}

section.bottom.visible {
    bottom: 0;
    transform: translate(-50%, 0);
}

section#scale .result {
    background-color: rgba(255,255,255,.8);
    border-radius: 1rem;
    padding: 1rem;
    color: #182389;
    text-align:center;
}

nav ul {
    display: flex;
    flex-direction: row;
    list-style: none;
    padding:0;
    margin: 0;
    width: 100%;
}

nav ul li {
    flex: 1;
    text-align:center;
    font-size: .6em;
    font-weight: 500;
    text-transform: uppercase;
    position: relative;
}

nav ul li:before {
    content: "";
    position: absolute;
    inset: .5em;
    border-radius: .5em;
    opacity: 0;
    background-color: rgba(24,35,137,.05);
    transition: all .3s ease-in-out;
    z-index: -1;
    pointer-events: none;
}

nav ul li:hover:before {
    opacity: 1;
}

nav ul li a {
    padding: 1rem;
    color: inherit;
    text-decoration: none;
    display: inline-block;
}

html.dark nav ul li a {
    color: white;
}

/*nav ul li + li {
    border-left: 1px solid #eee;
}

html.dark nav ul li + li {
    border-left: 1px solid #3e3b51;
}*/

nav ul li a span {
    width: 3em;
    height: 3em;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center center;
    display: inline-block;
}

html.dark nav ul li a span {
    filter: invert(100);
}

footer .settings {
    display: flex;
    justify-content: space-around;
    margin-bottom: 1em;
}

footer .settings a {
    color: inherit;
    font-weight: 700;
    text-decoration: none;
    border: 1px solid;
    border-radius: 5px;
    padding: 8px;
    display: inline-block;
    text-transform: uppercase;
}


@media screen and (max-width: 640px) {
    header {
        display:block;
        text-align:center;
    }

    header .logo, header h2 {
      display: none;
    }
}
