/* Reset some default styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    background-color: #121212;
    color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    overflow: hidden;
    position: relative;
    transition: background-color 0.3s ease;
}

.container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    position: relative;
    z-index: 2;
}

.form-container {
    background-color: #1e1e1e;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    padding: 35px;
    width: 100%;
    max-width: 400px;
    animation: fadeIn 1s ease-out;
}

h1 {
    text-align: center;
    color: #2196f3;
    margin-bottom: 20px;
    font-size: 2rem;
}

input {
    width: 100%;
    padding: 14px;
    margin-bottom: 18px;
    border: none;
    border-radius: 6px;
    background-color: #333;
    color: #fff;
    font-size: 1.1rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

input:focus {
    background-color: #444;
    outline: none;
    box-shadow: 0 0 8px rgba(33, 150, 243, 0.7);
}

button {
    width: 100%;
    padding: 14px;
    background-color: #2196f3;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1.1rem;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    transition: background-color 0.3s ease-in-out;
    margin-top: 20px;
    position: relative;
    display: flex;
    justify-content: center; /* Align content in the center */
    align-items: center;
}
button:disabled {
    background-color: #9e9e9e;
    cursor: not-allowed;
}

button:hover {
    background-color: #1976d2;
}

button:active {
    background-color: #1565c0;
}

button.loading {
    background-color: #64b5f6;
    cursor: progress;
    padding-right: 16px; 
    display: flex;
    justify-content: center;
    align-items: center;
}

button.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border: 3px solid #fff;
    border-radius: 50%;
    border-top: 3px solid transparent;
    animation: spin 1s linear infinite;
    margin-left: auto; 
    margin-right: auto;
}

p {
    text-align: center;
    margin-top: 10px;
    color: #bbb;
}

a {
    color: #2196f3;
    text-decoration: none;
    font-weight: bold;
}

a:hover {
    text-decoration: underline;
}

#errorBox {
    display: none;
    background-color: #f44336;
    color: white;
    padding: 10px;
    margin-bottom: 15px; /* Adjust margin to avoid overlap */
    border-radius: 6px;
    position: relative; /* Prevent it from floating above other elements */
    z-index: 2; /* Ensure it appears above the form when active */
    max-width: 100%;
    word-wrap: break-word; /* Ensure long text doesn't overflow */
}

#errorBox.active {
    display: block;
    margin-top: -10px; /* Position closer to the input fields */
}

#errorMessageText {
    display: inline-block;
    margin-right: 20px;
}

.close-error {
    position: absolute;
    top: 5px;
    right: 10px;
    background: none;
    border: none;
    color: white;
    font-weight: bold;
    cursor: pointer;
    font-size: 1.2rem;
}

#loginMessage {
    color: #2196f3;
    text-align: center;
    margin-top: 10px;
    font-size: 1.1rem;
}

/* Style the reCAPTCHA in dark mode */
.g-recaptcha {
    margin-top: 20px;
    transform: scale(0.85);
    transform-origin: 0 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.g-recaptcha iframe {
    background-color: #333;
    border-radius: 8px;
}

.g-recaptcha > div {
    background-color: #333 !important;
    border-radius: 8px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

@keyframes fadeIn {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Background with circular blurred blue circle */
body::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 400px;
    height: 400px;
    background-color: rgba(33, 150, 243, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    filter: blur(100px);
    z-index: 1;
    animation: glow 2s ease-in-out infinite;
}

@keyframes glow {
    0% {
        box-shadow: 0 0 20px rgba(33, 150, 243, 0.7);
    }
    50% {
        box-shadow: 0 0 40px rgba(33, 150, 243, 1);
    }
    100% {
        box-shadow: 0 0 20px rgba(33, 150, 243, 0.7);
    }
}

@media (max-width: 600px) {
    .form-container {
        padding: 20px;
        width: 90%;
        max-width: 100%;
    }

    h1 {
        font-size: 1.6rem;
    }

    input, button {
        font-size: 1rem;
        padding: 14px;
    }
}

@media (max-width: 600px) {
    #errorBox {
        font-size: 0.9rem; /* Reduce text size */
        margin-bottom: 10px; /* Less spacing for compact layout */
    }

    button.loading::after {
        width: 12px; /* Smaller spinner */
        height: 12px;
        border-width: 2px;
    }
}
