/* ----- COMMON STYLES ----- */

:root {
    --bg-color: #B7E4C7;
    --text-color: #1B4332;
    --box-color: #D8F3DC;
    scroll-behavior: smooth;
    scrollbar-color: var(--text-color) transparent;
}

:root.dark {
    --bg-color: #40916C;
    --text-color: #D8F3DC;
    --box-color: #1B4332;
}

.box, .header, body {
    transition: color 0.5s, background-color 0.5s;
}

body {
    margin: 0;
    font-family: Montserrat;
    background-color: var(--bg-color);
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
}

svg, g, path {
    fill: var(--text-color);
}

@supports (text-wrap-style: pretty) {
    p {
        text-wrap-style: pretty;
    }
}

/* ----- FLOATING UP BUTTON ----- */
.up-button {
    background-color: var(--box-color);
    width: min-content;
    height: min-content;
    padding: 8px;
    border-radius: 50%;
    color: var(--text-color);
    position: fixed;
    bottom: 5%;
    right: 5%;
    z-index: 10;
    user-select: none;
    text-decoration: none;
    box-shadow: 0 0 15px 0 #0006;
}

.up-button:hover {
    filter: opacity(0.7)
}

/* ----- HEADER ----- */

.header {
    background-color: var(--box-color);
    margin: 0;
    text-align: center;
    height: 70px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-sizing: border-box;
    padding: 10px;
    padding-left: 20px;
    position: relative;
}

.header::before {
    content: "";
    position: absolute;
    width: 100%;
    height: 3px;
    top: 100%;
    left: -100%;
    background-color: var(--text-color);
    animation: header-border-appear 1s cubic-bezier(.55,.09,.68,.53) both;
    z-index: 1;
}

.header__button {
    background-color: transparent;
    border: 3px solid var(--text-color);
    border-radius: 7px;
    padding: 8px 10px;
    color: var(--text-color);
    font-weight: bold;
    position: relative;
    overflow: hidden;
    transition: color 0.5s;
    font-size: 15px;
    z-index: 30;
}

.header__button::before {
    content: "";
    position: absolute;
    display: block;
    width: 100%;
    height: 100%;
    background-color: var(--text-color);
    left:-100%;
    top: 0;
    transition: left .5s;
    z-index: -1;

}

.header__button:hover {
    color: var(--box-color);
}
.header__button:hover::before {
    left: 0;
}

/* ----- FOOTER ----- */

.footer {
    margin-top: auto;
    width: 100%;
    text-align: center;
    background-color: var(--box-color);
    box-sizing: border-box;
}

.footer__content {
    color: var(--text-color);
    margin: 0;
    padding: 20px;
    letter-spacing: 1px;
}


/* ----- DEFAULT BOX ----- */

.box {
    background-color: var(--box-color);
    width: 100%;
    margin: 40px auto;
    color: var(--text-color);
    text-align: center;
    box-sizing: border-box;
    border-top: 3px solid var(--text-color);
    padding: 20px 10px;
    animation: box-appear 1s both;
    box-shadow: 0 6px 15px 0 #0007;
}

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


@media screen and (min-width: 480px) {
    .box {
        border-radius: 8px;
        width: clamp(360px, 80%, 900px);
    }
    .up-button {
        display: none !important;
    }
}

/* ----- ANIMATIONS ----- */

@keyframes header-border-appear {
    from {
        left: -100%;
    }
    to {
        left: 0;
    }
}

@keyframes box-appear {
    from {
        opacity: 0;
        translate: 60px;
    }
    to {
        opacity: 1;
        translate: 0;
    }
}