/* Reset and Root Variables */
:root {
    --light-gray: #c5d1f1;
    --bright-blue: #4E67EB;
    --dark-blue: #294D89;
    --error-red: #ff4d4f;
    --transition-speed: 0.3s;
    --font-size-base: 16px;
    --font-size-small: 14px;
    --font-size-large: 18px;
}

/* Reset Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Animated Gradient Background */
body {
    font-family: 'Roboto', sans-serif;
    background: linear-gradient(-45deg, #c5d1f1, #294D89, #4E67EB, #ffffff);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 1rem;
    position: relative;
    overflow: hidden;
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Loader Styles */
#loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.9);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
}

.spinner {
    border: 8px solid #f3f3f3;
    border-top: 8px solid var(--bright-blue);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Login Container Styling */
.login-container {
    background: white;
    border-radius: 8px;
    padding: 2.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    text-align: center;
    max-width: 400px;
    width: 100%;
    transition: all var(--transition-speed) ease;
    position: relative;
    animation: fadeIn 1s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Logo Styling */
.logo {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 1.5rem;
}

.logo img {
    max-width: 100%;
    height: auto;
    width: 150px;
    transition: transform var(--transition-speed);
}

.logo img:hover {
    transform: scale(1.05);
}

/* Form Styling */
form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    position: relative;
}

.input-group {
    position: relative;
    width: 100%;
}

.input-field {
    width: 100%;
    padding: 0.75rem 2.5rem 0.75rem 0.75rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
}

.input-field:focus {
    outline: none;
    border-color: var(--bright-blue);
    box-shadow: 0 0 5px rgba(78, 103, 235, 0.5);
}

.input-label {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    pointer-events: none;
    background-color: white;
    padding: 0 0.25rem;
    transition: all var(--transition-speed) ease;
    font-size: 1rem;
}

.input-field:focus + .input-label,
.input-field:not(:placeholder-shown) + .input-label {
    top: -0.6rem;
    font-size: 0.75rem;
    color: var(--bright-blue);
}

.password-toggle {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #999;
    font-size: 1.2rem;
    background: none;
    border: none;
    padding: 0;
    outline: none;
}

.password-toggle:hover {
    color: var(--bright-blue);
}

.button {
    width: 100%;
    padding: 0.75rem;
    border: none;
    border-radius: 4px;
    background-color: var(--bright-blue);
    color: white;
    font-size: 1.125rem;
    font-weight: bold;
    cursor: pointer;
    transition: background-color var(--transition-speed) ease, transform var(--transition-speed) ease;
}

.button:hover {
    background-color: var(--dark-blue);
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.button:active {
    transform: translateY(0);
    box-shadow: none;
}

.button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* Error Message Styling */
.error-message {
    color: var(--error-red);
    font-size: var(--font-size-small);
    margin-top: 0.25rem;
    display: none;
    text-align: left;
}

/* Instruction Text Styling */
.instruction {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: #555;
    text-align: left;
}

/* Responsive Design */
@media (max-width: 768px) {
    .login-container {
        padding: 2rem;
    }

    .logo img {
        width: 120px;
    }

    .input-field {
        padding-right: 2rem;
    }
}

@media (max-width: 480px) {
    .login-container {
        padding: 1.5rem;
    }

    .logo img {
        width: 100px;
    }

    .input-field {
        padding: 0.5rem 2rem 0.5rem 0.5rem;
        font-size: 0.9rem;
    }

    .input-label {
        font-size: 0.9rem;
    }

    .button {
        font-size: 1rem;
        padding: 0.6rem;
    }
}
