
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-image: url('../../../img/imageIUT.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    background-color: transparent !important;
    color: #333;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 0;
}

/* Ensure background image stays visible in dark mode with a darkening filter */
.dark-mode body,
body.dark-mode,
html.dark-mode body {
    background-image: url('../../../img/imageIUT.jpg') !important;
    background-size: cover !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
    background-attachment: fixed !important;
    background-color: transparent !important;
    position: relative;
}

/* Dark overlay filter for the background image in dark mode */
.dark-mode body::before,
body.dark-mode::before,
html.dark-mode body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: -1;
    pointer-events: none;
}

.form-title {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: #333;
    text-align: center;
}

.container {
    background-color: rgba(248, 249, 250, 0.95);
    padding: 2rem;
    border-radius: 8px;
    border: 1px solid #ddd;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    width: 100%;
    max-width: 400px;
}

.form-title {
    text-align: center;
    color: #333;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    font-weight: 500;
}

.image {
    height: 80px;
    max-width: 150px;
    object-fit: contain;
    margin-bottom: 1rem;
}

.logo {
    position: fixed;
    top: 20px;
    left: 20px;
    height: 100px;
    max-width: 180px;
    object-fit: contain;
    z-index: 1000;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #333;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background-color: #fff;
    transition: border-color 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #007bff;
}

.btn-submit {
    width: 100%;
    padding: 8px 16px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1rem;
}

.btn-submit:hover {
    background-color: #0056b3;
}

.login-link {
    text-align: center;
    margin-top: 1rem;
    color: #495057;
}

.login-link a {
    color: #007bff;
    text-decoration: none;
    font-weight: 500;
}

.login-link a:hover {
    text-decoration: underline;
}

.error-message {
    background-color: #f8d7da;
    color: #721c24;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 20px;
    border: 1px solid #f5c6cb;
}

.success-message {
    background-color: #d4edda;
    color: #155724;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 20px;
    border: 1px solid #c3e6cb;
}

.info-message {
    background-color: #e3f2fd;
    color: #1565c0;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 20px;
    border: 1px solid #2196f3;
    text-align: center;
}

.btn-submit:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
    transform: none;
}

.btn-submit:disabled:hover {
    background-color: #6c757d;
    transform: none;
}

.btn-submit.is-loading {
    position: relative;
}

.btn-submit.is-loading::after {
    content: '';
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.6);
    border-top-color: #fff;
    border-radius: 50%;
    display: inline-block;
    margin-left: 8px;
    vertical-align: middle;
    animation: button-spin 0.8s linear infinite;
}

.ajax-feedback {
    min-height: 0;
}

.ajax-feedback.error-message,
.ajax-feedback.success-message {
    margin-bottom: 20px;
    animation: slideIn 0.3s ease-out;
}

/* Verification code styles */
input[name="verification_code"] {
    text-align: center;
    font-size: 24px;
    letter-spacing: 5px;
    font-weight: bold;
    font-family: monospace;
}

/* Success message animation */
.success-message {
    animation: slideIn 0.3s ease-out;
}

.error-message {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes button-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Password field styles with eye icon */
.password-wrapper {
    position: relative;
}

.password-wrapper input {
    padding-right: 40px;
}

.toggle-password {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #666;
    user-select: none;
    font-size: 16px;
}

.toggle-password:hover {
    color: #333;
}