/* ------------------------- Base Styles ------------------------- */
body {
    font-family: Arial, sans-serif;
    background: linear-gradient(135deg, #007bff, #6610f2); /* Modern blue-purple gradient */
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
}

.container {
    background-color: #fff;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 0 15px rgba(0, 0, 0, 1.2), 0 0 30px rgba(0, 198, 255, 1.4);
    max-width: 400px;
    width: 100%;
    margin: 0 auto;  /* Centers the container horizontally */
    text-align: center;
}

.logo {
    width: 350px; /* Increased size for better visibility */
    max-width: 100%;
    margin-top: -5px;
    margin-bottom: 20px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

h2 {
    color: #333;
    margin-top: -5px;
    margin-bottom: 20px;
}

/* ------------------------- Username Field ------------------------- */
.username-group {
    position: relative;
    width: 80%;
    margin: 10px auto;
    text-align: center;
}

.username-group input[type="text"] {
    width: 80%;
    padding: 10px;
    margin: 10px auto;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 16px;
    text-align: center;
    gap: 5px;                  /* Optional gap between label and input */
}

.username-group input:focus {
    border-color: #007bff;
    outline: none;
    box-shadow: 0 0 5px rgba(0, 123, 255, 0.5);
}

/* ------------------------- Password Field ------------------------- */
.password-group {
    position: relative;
    width: 80%;
    margin: 10px auto;
    text-align: center;
}

/* Style both password and text types so toggling doesn't change size */
.password-group input[type="password"],
.password-group input[type="text"] {
    width: 80%;
    padding: 10px;
    margin: 10px auto;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 16px;
    text-align: center;
}

.password-group input:focus {
    border-color: #007bff;
    outline: none;
    box-shadow: 0 0 5px rgba(0, 123, 255, 0.5);
}

/* Toggle Password Icon within the Password Field */
.password-group .toggle-password {
    position: absolute;
    right: 35px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    user-select: none;
    color: #666;
    transition: color 0.2s ease;
}

.password-group .toggle-password:hover,
.password-group .toggle-password:active {
    color: #007bff;
}

/* Ensure the inline SVG uses currentColor */
.password-group .eye-icon {
    width: 20px;
    height: 20px;
    transition: fill 0.2s ease;
}


/* ------------------------- Captcha Field (One Row) ------------------------- */
.captcha-group {
    width: 65%;
    margin: 10px auto;
    background: #f9f9f9;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #ccc;
    display: flex;              /* Use flexbox for one-row layout */
    align-items: center;        /* Vertically center items */
    justify-content: center;    /* Horizontally center items */
    gap: 20px;                  /* Optional gap between label and input */
}

.captcha-group label {
    /* Remove block display so label and input stay in one row */
    margin: 0;
    color: #007bff;
    font-size: 14px;
    font-weight: bold;
    white-space: nowrap;        /* Prevent label from wrapping */
}

.captcha-group input[type="text"] {
    width: 30%;            /* Set a minimum width for the input */
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 15px;
    text-align: center;
}


/* ------------------------- Submit Button and Links ------------------------- */
button[type="submit"] {
    width: 25%;
    padding: 10px;
    background-color: #007bff;
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    margin: 10px auto 0;
    display: block;
}

button[type="submit"]:hover {
    background-color: #0056b3;
}

a {
    display: block;
    margin-top: 10px;
    color: #007bff;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ------------------------- Error Messages ------------------------- */
.error-message {
    color: red;
    font-size: 0.9em;
    margin-top: 3px;
    text-align: center;
    display: block;
}

/* ------------------------- Responsive Adjustments ------------------------- */
@media (max-width: 600px) {
    .container {
        padding: 20px;
    }
    .username-group,
    .password-group,
    .captcha-group {
        width: 90%;
    }
}
