@import '../../_common/_modules/css/_reset.css';
@import '../../_common/_modules/css/_root-colors.css';
@import '../../_common/_modules/css/_globe.css';

body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    background: var(--background-color);
    font-family: 'Inter', sans-serif;

    div[id="google_cookies_overlay"] {
        width: 100%;
        height: 100%;
        background-color: transparent;
        position: fixed;
        top: 0;
        left: 0;
    }

    div[id="google_cookies_banner"] {
        position: absolute;
        background-color: var(--title-color);
        color: #fff;
        width: 100%;
        padding: 1rem;
        display: flex;
        flex-direction: column;
        flex-wrap: wrap;
        gap: 1rem;
        font-size: 1.5rem;

        button {
            padding: 0.5rem;
            border: none;
            color: #fff;
            cursor: pointer;
        }

        button:first-of-type {
            background-color: var(--green-color);
            font-weight: bold;
        }

        button:last-of-type {
            background-color: orangered;
        }
    }

    main {
        width: 100%;
        display: flex;
        flex-direction: row;
        justify-content: center;
        flex-wrap: wrap;
        column-gap: 150px;
        row-gap: 50px;

        a[id="google_oauth"] {
            text-decoration: none;
            color: #000;
            display: flex;
            justify-content: center;
            align-items: center;
            gap: 0.5rem;
            padding: 0.25rem;
            box-shadow: rgba(0, 0, 0, 0.35) 0 5px 15px;
            border-radius: 0.25rem;
        }

        div[class~="divider-wrapper"] {
            display: flex;
            flex-direction: row;
            text-transform: uppercase;
            border: none;
            font-size: 12px;
            font-weight: 400;
            margin: 0;
            padding: 24px 0 0;
            align-items: center;
            justify-content: center;
            vertical-align: baseline;
        }

        div[class~="divider-wrapper"]::before,
        div[class~="divider-wrapper"]::after {
            content: "";
            border-bottom: 1px solid #c2c8d0;
            flex: 1 0 auto;
            height: .5em;
            margin: 0;
        }

        span[class~="divider"] {
            text-align: center;
            flex: 0.2 0 auto;
            font-weight: bold;
            font-size: 1rem;
        }

        div[class~="flash-message"] {
            margin: 0 auto;
            font-weight: bold;
            text-align: center;
            max-width: 300px;
        }

        div[class~="flash-message-success"] {
            color: var(--green-color);
        }

        div[class~="flash-message-error"] {
            color: red;
        }

        div[class~="flash-message-warning"] {
            color: var(--yellow-color);
        }

        section {
            box-shadow: rgba(0, 0, 0, 0.35) 0 5px 15px;
            background-color: #fff;
            padding: 1rem;

            h1 {
                margin: 0 0 1rem 0;
                font-weight: bold;
                text-align: center;
                color: var(--title-color);
            }

            form {
                display: flex;
                flex-direction: column;
                text-align: center;
                padding: 1rem 0;
                min-width: 500px;

                fieldset {
                    display: flex;
                    padding: 1rem;
                    margin-bottom: 1rem;
                    justify-content: center;

                    input:not([id="cgu"]) {
                        background-color: #f2f2f2;
                        height: 2rem;
                        border: none;
                        border-radius: 0.25rem;
                        box-shadow: rgba(0, 0, 0, 0.19) 0 10px 20px, rgba(0, 0, 0, 0.23) 0 6px 6px;
                        text-align: center;
                        width: 100%;
                    }

                    input[name="email"]:user-valid {
                        border: 0.1rem solid var(--green-color);
                    }

                    input[name="email"]:user-valid + span::before {
                        content: "✓";
                        color: var(--green-color);
                        margin-left: 0.25rem;
                        font-size: 1.5rem;
                    }

                    input[name="email"]:user-invalid,
                    input[name="uuid"]:user-invalid {
                        border: 0.1rem solid red;
                    }

                    input[name="email"]:user-invalid + span::before,
                    input[name="uuid"]:user-invalid + span::before {
                        content: "✖";
                        color: red;
                        margin-left: 0.25rem;
                        font-size: 1.25rem;
                    }
                }

                input[id="cgu"] {
                    margin-right: 0.5rem;
                }

                label[for="cgu"] {
                    font-weight: bold;

                    a {
                        color: #000;
                    }
                }

                button[type="submit"] {
                    color: #fff;
                    border: none;
                    padding: 0.5rem;
                    font-weight: bold;
                    font-size: 1rem;
                    cursor: pointer;
                }
            }
        }

        section[id="registration"] {
            display: flex;
            flex-direction: column;

            div[class~="divider-wrapper"] {
                margin: 0.5rem 0 0.5rem 0;
            }

            button[type="submit"] {
                background-color: var(--yellow-color);
            }
        }

        section[id="authentication"] {
            button[type="submit"] {
                background-color: var(--green-color);
            }

            a[class~="forgotten"] {
                display: block;
                text-align: center;
                color: var(--title-color);
                text-decoration: none;
                margin-bottom: 1rem;
            }
        }
    }
}

@media(max-width: 600px) {
    body {
        align-items: flex-start;

        main {
            row-gap: 2rem;

            section {
                width: 90%;

                form {
                    min-width: 100%;
                    max-width: 100%;
                }
            }

            section[id="registration"] {
                row-gap: 0;
                margin-top: 1rem;
            }
        }
    }
}
