@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,100..1000;1,9..40,100..1000&family=Outfit:wght@100..900&display=swap');

/* Variables */

:root {
    --theme: rgb(185 0 0);
    --theme-hover: rgb(215 0 0);
    --theme-active: rgb(200 0 0);
    --theme-gray: rgb(55 55 55);
    --theme-gray-hover: rgb(85 85 85);
    --theme-gray-active: rgb(70 70 70);
    --font-color: rgb(255 255 255);
    --font-size: 13px;
}

#mobile-navbar {
    display: none;
}

/* Retour à la normale */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    text-wrap: wrap;
    word-wrap: break-word;
    scroll-behavior: smooth;
}

img {
    height: 100%;
    width: auto;
    user-select: none;
}

a, button {
    color: var(--font-color);
    user-select: none;
    text-decoration: none;

    &:hover {
        cursor: pointer;
        transition-duration: 200ms;
    }

    &:active {
        transition-duration: 30ms;
    }
}

button {
    border: none;
}

/* Texte et taille de texte */

* {
    font-family: "DM Sans", sans-serif;
    font-optical-sizing: auto;
}

html {
    font-size: var(--font-size);
}

h1, h2, h3 {
    font-family: "Outfit", sans-serif;
    font-weight: 700;
}

h2 {
    display: flex;
    gap: 15px;
    align-items: center;
    justify-content: center;
    padding-right: 15px;

    img {
        height: calc(var(--font-size) * 3);
        border-radius: 100%;
    }
}

.shortened {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 90%;
    justify-self: center;
    text-align: center;
}

.subtitle {
    display: flex;
    flex-wrap: wrap;
    font-weight: 200;
    color: rgb(235 200 200);
    font-size: calc(var(--font-size) * 1.4);
    gap: 6px;

    a {
        color: inherit;
    }
}

.redirect-question {
    text-decoration: underline;
}

.note {
    font-size: calc(var(--font-size) * 1.1);

    &:hover {
        cursor: initial;
    }
}

/* Document préparation au contenu */

body {
    position: relative;
    background-color: rgb(25 12 12);
    background-size: 100vw 100vh;
    background-attachment: fixed;
    color: var(--font-color);
}

main {
    max-width: 100vw;
    width: 100%;
}

div {
    align-content: start;
}

/* Navbar */

html {
    height: 100%;
    scroll-behavior: smooth;
    scroll-margin: 30px;
}

body {
    height: 100%;
}

#navbar {
    display: grid;
    padding: 25px 65px;
}

#mobile-navbar {
    padding: 15px 65px;
    row-gap: 15px;
}

#navbar, #mobile-navbar {
    align-content: start;
    z-index: 2;
    top: -1px;
    position: sticky;
    grid-template-columns: auto max-content;
    margin-top: 15px;

    nav {
        display: flex;
        column-gap: 10px;
    }

    nav:first-child a {
        font-weight: bold;
        font-size: calc(var(--font-size) * 1.40);
        text-align: left;
        align-content: center;
    }

    &:not(.pinned) {
        transition-duration: 0.2s;
    }

    &.pinned {
        background: rgba(22, 22, 22, 0.1);
        border-radius: 16px;
        backdrop-filter: blur(10px);
        transition-duration: 0.2s;
    }
}

/* Boutons */

.boutons {
    gap: 15px;

    &:not(.liste) {
        display: flex;
        flex-wrap: wrap;
    }

    &.liste {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .btn {
        min-width: max-content;
        max-width: 50%;
    }
}

.btn {
    display: inline-block;
    padding: 11px 25px;
    border: none;
    font-size: calc(var(--font-size) * 1.05);
    border-radius: 8px;
    font-weight: 700;
    text-wrap: nowrap;
    text-overflow: ellipsis;
    text-align: center;
    width: max-content;
    justify-content: center;
    background: none;

    &:hover:not(:active), &:hover, &:active {
        transition-duration: 0.2s;
    }
}

.big-btn {
    column-gap: 5px;
    display: flex;
    padding: 15px 30px;

    &.arrow:after {
        content: "";
        height: calc(var(--font-size) * 1.35);
        width: calc(var(--font-size) * 1.35);
        background-size: 100% auto;
        background-repeat: no-repeat;
    }

    &.primary-btn.arrow:after {
        background-image: url("/images/symbols/arrow_right_black.svg");
    }

    &.ghost-btn.arrow:after {
        background-image: url("/images/symbols/arrow_right_white.svg");
    }
}

.primary-btn {
    border: 1px solid rgb(223 0 0);
    background-color: rgb(223 0 0);
    color: black;

    &:hover {
        border: 1px solid rgb(255 25 25);
        background-color: rgb(255 25 25);
    }

    &:active {
        border: 1px solid rgb(223 0 0);
        background-color: rgb(223 0 0);
    }
}

.ghost-btn {
    border: 1px solid rgb(223 0 0 / 0.8);

    &:hover {
        border: 1px solid rgb(255 0 0 / 1);
        background-color: rgb(120 30 30 / 0.13);
    }

    &:active {
        border: 1px solid rgb(223 0 0 / 0.8);
        background-color: rgb(120 30 30 / 0.27);
    }
}

/* Séparation des documents */

section {
    display: grid;
    padding: 50px 65px;
    margin-left: auto;
    margin-right: auto;
    max-width: 1500px;
    align-content: start;

    &.unique .presentation {
        width: 55%;
    }

    &.welcome-main-section {
        display: grid;
        grid-template-columns: 55% auto;
        gap: 80px;
    }

    &.friend:not(:last-child) {
        padding-bottom: 0;

        + *:not(.alert), + .alert + * {
            padding-top: 70px;
        }
    }
}

/* Présentation */

.presentation {
    justify-content: start;
    display: grid;
    row-gap: 35px;

    h1 + p {
        line-height: 2.2;
    }

    .liste {
        justify-self: start;
        justify-content: start;
        width: 80%;
    }
}

h1 {
    font-size: calc(var(--font-size) * 4);
    line-height: 1.32;

    >span {
        color: rgb(235 20 20);
    }
}

h2 {
    font-size: calc(var(--font-size) * 1.5);
}

/* Incitative */

.incitative {
    grid-template-columns: 1fr 1fr;
    align-content: center;
    gap: 30px;

    >* {
        justify-content: center;
        align-content: center;
    }

    h1 {
        font-size: calc(var(--font-size) * 5);
        text-align: center;
    }
}

/* Bubbles et check-boutons */

.bubbles, .big-bubbles {
    display: grid;
    list-style: none;
    min-width: min-content;
    max-width: max-content;
    user-select: none;

    li {
        display: grid;
        grid-template-columns: max-content auto;
        column-gap: 10px;
        font-weight: bold;
        align-content: center;
    }
}

.bubbles {
    align-content: start;
    gap: 20px;

    li {
        background-color: rgb(85 12 12 / 0.22);
        border: red solid 1px;
        border-radius: 20px;
        padding: 12px 20px;

        &:before {
            content: "•";
        }
    }
}

.big-bubbles {
    transition-duration: 0.2s;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 15px;

    li {
        border: 1px solid rgb(255 18 18 / 0.89);
        border-radius: 10px;
        min-height: max-content;
        padding: 18px 20px;
        align-content: start;

        &:before {
            content: "✓";
        }
    }
}

.check-boutons {
    display: flex;
    flex-wrap: wrap;

    button {
        display: grid;
        grid-template-columns: auto max-content;
        gap: 15px;
        background: none;
        height: 30px;
        font-size: calc(var(--font-size) * 1.15);
        font-weight: bold;

        >:first-child {
            margin: auto;
        }

        >:last-child {
            display: flex;
            height: 100%;
            padding: 4px 7px;
            width: 70px;
            border: 2px solid white;
            border-radius: 10px;
            justify-content: left;

            &:after {
                background-color: white;
                border-radius: 10px;
                width: 50%;
                content: "";
            }
        }
    }

    button.y>:last-child {
        border: 2px solid rgb(255 18 18);
        justify-content: right;

        &:after {
            background-color: rgb(255 18 18);
        }
    }
}

/* Dashboard */

.dashboard {
    gap: 70px;

    .btn {
        width: 100%;
    }

    >div:not(.subtitle) {
        display: flex;
        flex-wrap: wrap;
        gap: 20px 40px;

        >div {
            display: grid;
            gap: 10px;
            width: 100%;
            max-width: 350px;

            >div:not(.boutons) {
                padding: 15px 0;
                display: grid;
                gap: 10px;
            }
        }
    }

    &.individual>div:not(.subtitle)>div {
        max-width: 300px;
    }
}

/* Dashboard et formulaire */

.dashboard>div>div>div, form {
    display: grid;
    grid-template-columns: 1fr;
    border: rgb(198 21 21 / 0.75) 1px solid;
    justify-content: start;
    text-align: left;
}

.dashboard>div.subtle>div>div, form.subtle {
    padding: 10px 0;
    border: none;

    &:not(form) {
        padding: 20px 0;
    }
}

/* Formulaire */

form {
    gap: 40px;

    &:not(.subtle) {
        padding: 60px;
    }

    >div {
        display: grid;
        grid-template-columns: 250px auto;
        gap: 20px;
    }

    >*:not(div) {
        column-span: all;
    }

    &.no-style, &.check-boutons {
        padding: 0;
        margin: 0;
        border: none;
    }
}

label {
    font-size: calc(var(--font-size) * 1.5);

    &.remember {
        font-size: calc(var(--font-size) * 1.2);
        align-content: center;
        margin-left: 10px;
    }

    >input {
        align-content: center;
        margin-right: 10px;
    }
}

input, textarea {
    background-color: transparent;
    outline: none;
    color: var(--font-color);
    font-size: calc(var(--font-size) * 1.2);
    text-align: start;
    height: fit-content;

    &:autofill {
        background-color: transparent;
    }

    &:focus {
        border-color: var(--theme-hover);
    }
}

input {
    border: none;
    border-bottom: #a5a5a5 1px solid;
    max-width: 450px;
    padding-bottom: 20px;
}

textarea {
    border: #a5a5a5 1px solid;
    min-height: 250px;
    padding: 20px;
    max-width: calc(450px + 40px);
    height: fit-content;
    resize: none;
    overflow: hidden;
}

.form-section {
    max-width: 1100px;

    textarea {
        min-width: 100%;
    }

    .boutons {
        display: flex;
        flex-wrap: nowrap;

        &.options {
            flex-wrap: wrap;
            justify-content: center;

            .btn {
                width: min(49%, 50% - 15px);
            }
        }
    }

    .btn {
        width: 100%;
    }
}

h1 + form {
    margin-top: 20px;
}

/* Erreurs */

.alert {
    top: 0;
    left: 0;
    position: fixed;
    display: grid;
    grid-template-rows: max-content minmax(min-content, 100%);
    z-index: 3;
    height: 70vh;
    width: 55vw;
    min-height: max-content;
    min-width: max-content;
    background-color: #270202;
    font-size: calc(var(--font-size) * 1.13);

    .barre {
        background-color: rgb(108 20 20 / 0.25);
        width: 100%;
        padding: 8px;
        display: grid;
        grid-template-columns: max-content auto max-content;
        gap: 15px;

        span {
            align-content: center;
        }

        img:last-child:hover {
            cursor: pointer;
        }
    }

    .message {
        padding: 15px;
    }
}

/* Adaptation à l'écran */

@media screen and (min-width: 1500px) {
    .bubbles {
        line-height: 2;
    }
}

@media screen and (max-width: 1150px) {
    .bubbles li {
        max-width: 100% !important;
    }

    .incitative h1 {
        font-size: calc(var(--font-size) * 4.5);
    }
}

@media screen and (max-width: 850px) {
    section {
        grid-template-columns: 1fr !important;
        margin-bottom: 0 !important;
    }

    .bubbles, .big-bubbles {
        grid-template-columns: 1fr 1fr;
    }

    h1 {
        font-size: calc(var(--font-size) * 3.5);
    }

    :root {
        --font-size: 12px;
    }
}

@media screen and (max-width: 775px) {
    section.form-section {
        justify-content: center;

        h1 {
            width: 85%;
            margin-left: auto;
            margin-right: auto;
        }

        form {
            width: 85%;
            margin-left: auto;
            margin-right: auto;

            div:not(.boutons) {
                grid-template-columns: 1fr;
                row-gap: 30px;
            }
        }
    }

    .form-section .boutons {
        flex-wrap: wrap;
    }

    .boutons .btn {
        max-width: 100% !important;
        width: 100% !important;
    }
}

@media screen and (max-width: 650px) {
    section.form-section {
        h1, form {
            width: 100%;
        }
    }

    h1 {
        font-size: calc(var(--font-size) * 3);
    }

    .bubbles {
        grid-template-columns: 1fr;
        max-width: 100% !important;
    }

    .dashboard {
        >div {
            display: grid !important;
            grid-template-columns: 1fr;

            >div {
                width: 100% !important;
            }
        }

        &.individual>div:not(.subtitle)>div {
            max-width: 100%;

            .btn {
                padding: 10px;
            }
        }

        div.subtle>div {
            h2 {
                font-size: calc(var(--font-size) * 2.1);

                img {
                    height: calc(var(--font-size) * 3.3);
                }
            }

            .btn {
                width: 80%;
                margin: auto;
            }
        }
    }

    .check-boutons {
        display: grid;
        justify-self: center;
        width: 85%;

        button {
            width: 100% !important;
            height: 40px;
            font-size: calc(var(--font-size) * 1.38);

            >span {
                margin: auto 0 !important;
                justify-self: start;
            }

            >div {
                width: 85px !important;
                padding: 6px !important;
            }
        }
    }
}

@media screen and (max-width: 600px) {
    ul.big-bubbles {
        grid-template-columns: 1fr;
        max-width: 100% !important;
    }

    header, section {
        padding-left: 35px !important;
        padding-right: 35px !important;
    }
}

@media screen and (max-width: 570px) {
    .incitative h1 {
        font-size: calc(var(--font-size) * 4);
    }
}

@media  screen and (max-width: 525px),
        only screen and (hover: none) and (pointer: coarse) {

    :root {
        --font-size: 11px;
    }

    label.remember {
        margin: auto;
    }

    section.form-section form:not(.subtle) {
        padding: 40px;
    }

    .incitative .boutons {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    #navbar {
        display: none;
    }

    #mobile-navbar {
        display: grid;

        a:not(.btn) {
            font-size: calc(var(--font-size) * 1.9) !important;
        }

        >:nth-child(2) {
            justify-self: end;
        }

        #mobile-nav-button:after {
            transition-duration: 0.2s;
            content: "☰";
        }

        #mobile-nav-button.opened:after {
            transition-duration: 0.2s;
            content: "▼";
        }

        #mobile-nav-content {
            transition-duration: 0.2s;
            grid-column: 1 / 3;
            grid-template-columns: 1fr 1fr;
            display: none;

            &.opened {
                transition-duration: 0.2s;
                display: grid;
            }

            >* {
                width: 100%;
            }
        }
    }

    #mobile-navbar>nav:last-child {
        grid-template-columns: 1fr !important;
        gap: 10px;
    }
}

@media screen and (max-width: 490px) {
    .check-boutons {
        width: 95%;
    }
}

@media screen and (max-width: 450px) {
    :root {
        --font-size: 11px;
    }

    section.form-section form .redirect-question {
        margin: auto;
    }

    .incitative {
        .boutons {
            grid-template-columns: 1fr;
            width: 100%;
            max-width: 90%;
            margin: auto;
        }

        h1 {
            font-size: calc(var(--font-size) * 3.5);
        }
    }

    .dashboard div.subtle>div .btn {
        width: 90%;
    }
}

@media screen and (max-width: 390px) {
    .incitative h1 {
        font-size: calc(var(--font-size) * 3);
    }

    h1 {
        font-size: calc(var(--font-size) * 2.5);
    }

    section.form-section form {
        padding: 30px;
    }

    .check-boutons {
        gap: 25px;

        button {
            font-size: calc(var(--font-size) * 1.5);
            grid-template-columns: 1fr;
            height: max-content;
            gap: 20px;

            >span {
                justify-self: center;
            }

            >div {
                border-width: 1px !important;
                width: 75% !important;
                height: 45px !important;
                padding: 8px !important;
                margin: auto;
            }
        }
    }

    .dashboard div.subtle>div .btn {
        width: 100%;
    }
}