::-webkit-scrollbar,
img::selection,
br,
a::selection,
h1::selection {
    background: none;
    display: none;
    pointer-events: none;
}

* {
    -webkit-user-select: none;
    -ms-user-select: none;
    user-select: none;
    padding: 0;
    margin: 0;
    color: black;
    box-sizing: border-box;
    text-decoration: none;
    list-style: none;
    font-family: "Poppins", system-ui, sans-serif;
    background: none;
    border: none;
    outline: none;
    font-family: "Host Grotesk", sans-serif;
}

body {
    width: 100vw;
    min-height: 500px;
    height: 100vh;
    display: grid;
    place-content: center;
    background: url(../images/background.png);
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    font-family: "Host Grotesk", sans-serif;
    /* Allow normal wrapping by default so long words (eg. "password") don't overflow */
    white-space: normal;
}

section {
    display: flex;
    max-height: 480px;
    min-height: 480px;
    height: 90vh;
    max-width: 800px;
    width: 90vw;
    overflow: hidden;
    box-shadow: rgba(0, 0, 0, 0.35) 0px 5px 15px;
}

#cover {
    flex: 1;
    height: 100%;
    position: relative;
}

#cover * {
    color: #eee;
}

#icon {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 2;
    filter: invert(1);
}

#sliderContainer {
    width: 100%;
    height: 100%;
}

#sliderContainer div {
    width: 100%;
    height: 100%;
    position: relative;
}

#sliderContainer h1 {
    position: absolute;
    top: 50%;
    width: 70%;
    left: 50%;
    transform: translate(-50%, -50%);
}

#sliderContainer .about {
    position: absolute;
    bottom: 50px;
    width: 70%;
    height: 40px;
    display: flex;
    justify-content: space-between;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
}

.controlLabels {
    display: flex;
    justify-content: end;
    gap: 7px;
}

.controlLabels label {
    border: 0.5px solid #fff;
    opacity: 0.7;
    width: 30px;
    height: 30px;
    display: grid;
    place-content: center;
    border-radius: 50px;
    padding-bottom: 4px;
    cursor: pointer;
}

#sliderContainer #model1,
#sliderContainer #model2,
#sliderContainer #model3,
#sliderContainer #model4 {
    display: none;
}

#slide1:checked ~ #sliderContainer #model1,
#slide2:checked ~ #sliderContainer #model2,
#slide3:checked ~ #sliderContainer #model3,
#slide4:checked ~ #sliderContainer #model4 {
    position: absolute;
    left: 0;
    top: 0;
    display: block;
}

#sliderContainer div img {
    position: absolute;
    left: 0;
    top: 0;
    z-index: -1;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(1.5px) brightness(0.9);
}

#loginForm {
    width: 300px;
    height: 100%;
    padding-top: 70px;
    background: #fff;
    padding-inline: 25px;
    /* allow wrapping inside the form column so labels and text wrap naturally */
    white-space: normal;
    overflow-y: auto;
}

#loginForm.signup {
    padding-top: 38px;
}

#createAccountForm {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-inline: auto;
    margin-block: 10px;
}

input[type="text"],
input[type="email"],
input[type="password"],
button {
    flex: 1;
    padding: 7px 10px;
    font-size: 1em;
    width: 100%;
    border: 0.5px solid #eee;
    border-radius: 7px;
}

input:focus {
    border: 0.5px solid #333;
}

button {
    font-size: 0.9em;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    font-weight: bold;
}

button,
a {
    cursor: pointer;
}

#createAccount {
    color: #eee;
    background: #0f1823;
}
/* Disabled state for buttons (prevents interaction and shows a gray, forbidden cursor) */
button:disabled,
button[disabled],
#loginForm button:disabled,
#loginForm #createAccount:disabled,
#createAccount[disabled] {
    background: #9e9e9e !important; /* neutral gray */
    color: #f5f5f5 !important;
    cursor: not-allowed !important;
    opacity: 0.85 !important;
    box-shadow: none !important;
    pointer-events: none !important; /* ensure no clicks */
}

.login {
    display: flex;
    flex-direction: column; /* Change to column to stack elements vertically */
    align-items: center;
    gap: 5px;
    margin-top: 10px; /* Adjusted margin to ensure visibility */
}

.login *,
small {
    text-align: center;
    font-size: 0.8em;
    opacity: 0.7;
}

a {
    opacity: 1;
}

small {
    font-size: 0.7em;
}

.error {
    display: block;
    margin-top: 5px;
    margin-left: 0px;
    color: red;
    white-space: normal;
}

/* Styles for the checkbox and its label */
.cgu {
    display: flex;
    align-items: center;
    margin-top: 10px;
}

input[type="checkbox"] {
    margin-right: 10px;
}

label[for="cgu"] {
    display: flex;
    align-items: center;
    font-size: 0.9em;
    color: #333;
    white-space: nowrap;
}

label[for="cgu"] a {
    color: #0f1823;
    text-decoration: underline;
    margin-left: 5px;
}

/* Styles for the password container and toggle icon */
.password-container {
    position: relative;
    width: 100%;
}

.password-container input {
    width: calc(100% - 40px); /* Adjust width to make space for the icon */
    padding-right: 40px; /* Add padding to the right to avoid overlap with the icon */
}

.toggle-password {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    cursor: pointer;
}

.toggle-password img {
    width: 20px;
    height: 20px;
}

/* Styles for the Google Sign-In button */
.g_id_signin {
    width: 100%;
    display: flex;
    justify-content: center;
}

#g_id_onload {
    display: none;
}

#discordLogin {
    margin-bottom: 5px; /* Adjusted margin to reduce space */
}

a {
    text-decoration: underline;
}

/* Style for the new-line link */
#new-line {
    margin-top: 5px; /* Add margin to separate it from other links */
    font-size: 0.8em;
    color: #0f1823;
}

@media (max-width: 650px) {
    section {
        width: 300px;
    }

    #cover {
        display: none;
    }

    #loginForm {
        padding-top: 60px;
    }
}


.toast-message {
    position: fixed;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #333;
    color: white;
    padding: 16px;
    border-radius: 4px;
    z-index: 1000;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: top 0.5s ease;
    max-width: 80%;
    text-align: center;
}

.toast-message.show {
    top: 20px;
}

/* Fix browser autofill background (Chrome) and ensure text color stays consistent */
input:-webkit-autofill,
input:-webkit-autofill:focus,
input:-webkit-autofill:hover {
    -webkit-box-shadow: 0 0 0px 1000px #fff inset !important;
    box-shadow: 0 0 0px 1000px #fff inset !important;
    -webkit-text-fill-color: #000 !important;
}