/* Variables for the appearance of the layout */

:root {
    --red: #dc0000;
    --light-grey: #767d80;
    --dark-grey: #485156;
    --white: #efefef;
    --spacing: 10px;
}

/* Reset elements */

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

/* HTML & body */

html,
body {
    color: var(--dark-grey);
    font-family: sans-serif;
    font-size: 18px;
    min-height: 100%;
}

body {
    background-image: url('/static/img/background.jpg');
    background-size: cover;
}

/* Links */

a {
    color: inherit;
    text-decoration: none;
}

a.active {
    color: var(--red);
}

a:hover {
    text-decoration: underline;
}

/* Inputs */

input {
    border: 0;
    color: var(--white);
    padding: var(--spacing);
    width: 100%;
}

/* Main grid container */

main {
    display: grid;
    gap: var(--spacing);
    grid-template-areas:
        "logo header header header language"
        "plan rpc . design ."
        ". . devis contact contact"
        ". . footer footer footer";
    grid-template-columns: repeat(5, 1fr);
    width: 90%;
    max-width: 1000px;
    margin: 0 auto;
}

@media (width <= 1000px) {
    main {
        grid-template-areas:
            "logo header header"
            ". . language"
            "plan design ."
            ". rpc devis"
            ". contact contact"
            "footer footer footer";
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (width <= 800px) {
    main {
        grid-template-areas:
            "logo ."
            "header header"
            ". language"
            "plan design"
            "rpc devis"
            "contact contact"
            "footer footer";
        grid-template-columns: repeat(2, 1fr);
    }
}

main > * {
    align-items: flex-start;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    padding: calc(var(--spacing) * 2);
    position: relative;
}

main > a:hover {
    text-decoration: none;
}

/* Header & footer */

header,
footer {
    justify-content: center;
}

header {
    gap: var(--spacing);
    grid-area: header;
    font-size: 2rem;
}

footer {
    backdrop-filter: blur(2px);
    flex-direction: row;
    font-size: 0.75em;
    grid-area: footer;
    justify-content: space-between;
    mask-image: linear-gradient(to top, transparent 0%, #000000 30%, #000000 60%, transparent 100%);
    padding: calc(var(--spacing) * 2) 0;
    text-shadow: 1px 1px 4px var(--white);
}

#logo {
    align-items: center;
    aspect-ratio: 1;
    grid-area: logo;
    justify-content: center;
}

#logo img {
    width: 80%;
}

#language {
    align-items: center;
    flex-direction: row;
    grid-area: language;
    justify-content: space-around;

}

/* Applications */

#design,
#devis,
#plan,
#rpc {
    aspect-ratio: 1;
    color: var(--white);
}

#plan {
    background-color: var(--red);
    grid-area: plan;
}

#rpc {
    background-color: var(--dark-grey);
    grid-area: rpc;
}

#design {
    background-color: var(--red);
    grid-area: design;
}

#devis {
    background-color: var(--light-grey);
    grid-area: devis;
}

#contact {
    background-color: var(--white);
    grid-area: contact;
}

/* Application content */

.content {
    display: flex;
    flex-direction: column;
    gap: var(--spacing);
    position: relative;
    width: 100%;
}

a .content,
.content input {
    padding-right: 30px; /* absolute-positioned arrow icon */
}

input::placeholder {
    color: var(--white);
}

#contact .content {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-end;
}

#address {
    font-size: 0.75rem;
}

#address p {
    margin-top: var(--spacing);
}

#devis input {
    background-color: var(--dark-grey);
}

#rpc input {
    background-color: var(--light-grey);
    position: relative;
}

/* Icons */

.arrow {
    background-image: url('/static/img/icon/arrow.svg');
    background-position: center right;
    background-repeat: no-repeat;
    bottom: calc(var(--spacing) * 2 + 8px);
    cursor: pointer;
    height: 18px;
    position: absolute;
    right: calc(var(--spacing) * 2 + 8px);
    width: 18px;
}

.icon {
    height: 22px;
}

.icon.large {
    height: 45px;
}

/* Helper classes */

.red {
    color: var(--red);
}
