/* Login Page - Ultra Modern Design */

/* CSS Variables - Clean Teal/Green/Blue Palette */
:root {
    --primary-color: #0e563b;
    --teal-color: #16a085;
    --green-primary: #169880;
    --green-light: #1abc9c;
    --blue-color: #3498db;
    --blue-light: #5dade2;
    --text-color: #2c3e50;
    --text-light: #6b7280;
    --text-muted: #95a5a6;
    --bg-primary: #f8f9fa;
    --bg-secondary: #ffffff;
    /* --bg-gradient: linear-gradient(135deg, #f8f9fa 0%, #e8f5e9 100%); */
    --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.12);
    --border-radius: 16px;
    --footer-bg: #063828;

}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

/* Base Layout */
html, body {
    height: 100%;
    margin: 0;
    display: flex;
    flex-direction: column;
}

body {
    font-family: 'Work Sans', sans-serif;
    color: var(--text-color);
    background: var(--bg-gradient);
    background-attachment: fixed;
    overflow-x: hidden;
}

/* Animated Background Pattern */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 15% 25%, rgba(22, 160, 133, 0.06) 0%, transparent 50%),
        radial-gradient(circle at 85% 75%, rgba(52, 152, 219, 0.06) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(22, 152, 128, 0.04) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
    animation: float 20s ease-in-out infinite;
}

/* Main Login Page */
main.login-page {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.5rem;
    box-sizing: border-box;
    position: relative;
    z-index: 1;
}

/* Login Container */
.login-container {
    width: 200%;
    max-width: 5680px;
    animation: fadeInUp 0.8s ease;

}

/* Login Header */
.login-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.login-icon {
    width: 90px;
    height: 90px;
    margin: 0 auto 1.75rem;
    background: linear-gradient(135deg, var(--teal-color), var(--green-light));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: scaleIn 0.6s ease;
    box-shadow: 0 8px 24px rgba(22, 160, 133, 0.3);
    border: 4px solid rgba(255, 255, 255, 0.5);
    position: relative;
    overflow: hidden;
}

.login-icon::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.2) 0%, transparent 70%);
    animation: float 4s ease-in-out infinite;
}

.login-icon i {
    font-size: 2.75rem;
    color: white;
    position: relative;
    z-index: 1;
}

.login-title {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0 0 0.75rem 0;
    font-family: 'Work Sans', sans-serif;
    letter-spacing: -0.5px;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.05);
}

.login-subtitle {
    font-size: 1.1rem;
    color: var(--text-light);
    margin: 0;
    font-family: 'Work Sans', sans-serif;
    font-weight: 400;
    letter-spacing: 0.2px;
}

/* Login Card - Modern Glass Design */
.login-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 3rem;
    box-shadow: var(--shadow-lg);
    box-sizing: border-box;
    border: 1px solid rgba(255, 255, 255, 0.6);
}

/* Form Styles */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.form-label {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-family: 'Work Sans', sans-serif;
    letter-spacing: 0.2px;
}

.form-label i {
    color: var(--teal-color);
    font-size: 1.1rem;
}

.form-input {
    width: 100%;
    padding: 1rem 1.25rem;
    border: 2px solid rgba(22, 160, 133, 0.2);
    border-radius: 12px;
    font-size: 1rem;
    font-family: 'Work Sans', sans-serif;
    font-weight: 400;
    transition: all 0.3s ease;
    box-sizing: border-box;
    background: var(--bg-secondary);
    color: var(--text-color);
    box-shadow: var(--shadow-sm);
}

.form-input:focus {
    outline: none;
    border-color: var(--teal-color);
    box-shadow: 0 4px 15px rgba(22, 160, 133, 0.15), 0 0 0 4px rgba(22, 160, 133, 0.1);
    transform: translateY(-1px);
}

.form-input::placeholder {
    color: var(--text-muted);
    font-family: 'Work Sans', sans-serif;
}

select.form-input {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2316a085' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1.25rem;
    padding-right: 3rem;
}

.loading-text {
    font-size: 0.9rem;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-family: 'Work Sans', sans-serif;
    font-weight: 500;
}

.loading-text i {
    color: var(--teal-color);
}

.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-wrapper .form-input {
    padding-right: 3.5rem;
}

.password-toggle {
    position: absolute;
    right: 1rem;
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0.6rem;
    transition: all 0.3s ease;
    border-radius: 8px;
}

.password-toggle:hover {
    color: var(--teal-color);
    background: rgba(22, 160, 133, 0.1);
}

.password-toggle:active {
    transform: scale(0.95);
}

/* Login Button - Modern Gradient */
.login-button {
    width: 100%;
    padding: 1.1rem 2rem;
    background: linear-gradient(135deg, var(--teal-color), var(--green-light));
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    font-family: 'Work Sans', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    box-shadow: 0 4px 15px rgba(22, 160, 133, 0.3);
    letter-spacing: 0.3px;
    position: relative;
    overflow: hidden;
}

.login-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.login-button:hover::before {
    left: 100%;
}

.login-button:hover {
    background: linear-gradient(135deg, var(--green-light), var(--blue-color));
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(22, 160, 133, 0.4);
}

.login-button:active {
    transform: translateY(0);
}

.login-button:disabled {
    background: linear-gradient(135deg, #ccc, #aaa);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.login-button i {
    font-size: 1.2rem;
}

/* Login Footer */
.login-footer {
    margin-top: 2.5rem;
    text-align: center;
    padding-top: 2rem;
    border-top: 2px solid rgba(0, 0, 0, 0.05);
}

.footer-text {
    color: var(--text-light);
    margin: 0 0 1rem 0;
    font-size: 1rem;
    font-family: 'Work Sans', sans-serif;
    font-weight: 500;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--teal-color);
    text-decoration: none;
    font-weight: 600;
    font-family: 'Work Sans', sans-serif;
    font-size: 1rem;
    transition: all 0.3s ease;
    padding: 0.5rem 1rem;
    border-radius: 8px;
}

.back-link:hover {
    color: var(--green-light);
    background: rgba(22, 160, 133, 0.1);
    transform: translateX(-3px);
}

.back-link i {
    transition: transform 0.3s ease;
}

.back-link:hover i {
    transform: translateX(-3px);
}

/* Footer */
footer {
    background-color: var(--footer-bg);
    color: white;
    text-align: center;
    padding: 30px;
    width: 100%;
    flex-shrink: 0;
    box-sizing: border-box;
    font-family: 'Work Sans', sans-serif;
    font-size: 0.9rem;
    position: relative;
    z-index: 1;
}

footer p {
    margin: 0;
    font-weight: 400;
    letter-spacing: 0.3px;
}

/* Error/Success Messages */
.message-box {
    padding: 1rem 1.25rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    font-weight: 500;
    font-family: 'Work Sans', sans-serif;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: fadeInUp 0.4s ease;
}

.message-box.error {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.message-box.success {
    background: rgba(39, 174, 96, 0.1);
    color: #27ae60;
    border: 1px solid rgba(39, 174, 96, 0.2);
}

.message-box i {
    font-size: 1.2rem;
}

/* Loading Spinner */
.fa-spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .login-container {
        max-width: 95%;
    }

    .login-card {
        padding: 2.5rem 2rem;
    }

    .login-title {
        font-size: 2rem;
    }

    .login-subtitle {
        font-size: 1rem;
    }

    .login-icon {
        width: 80px;
        height: 80px;
    }

    .login-icon i {
        font-size: 2.5rem;
    }
}

@media (max-width: 480px) {
    main.login-page {
        padding: 1.5rem 1rem;
    }

    .login-container {
        max-width: 100%;
    }

    .login-header {
        margin-bottom: 2rem;
    }

    .login-card {
        padding: 2rem 1.5rem;
        border-radius: 16px;
    }

    .login-title {
        font-size: 1.75rem;
    }

    .login-subtitle {
        font-size: 0.95rem;
    }

    .login-icon {
        width: 70px;
        height: 70px;
        margin-bottom: 1.5rem;
    }

    .login-icon i {
        font-size: 2.25rem;
    }

    .form-group {
        gap: 0.5rem;
    }

    .form-input {
        padding: 0.9rem 1rem;
        font-size: 0.95rem;
    }

    .login-button {
        padding: 1rem 1.75rem;
        font-size: 1rem;
    }

    .login-footer {
        margin-top: 2rem;
        padding-top: 1.75rem;
    }

    .footer-text {
        font-size: 0.95rem;
    }

    .back-link {
        font-size: 0.95rem;
    }
}

/* Focus States for Accessibility */
.form-input:focus,
.login-button:focus,
.password-toggle:focus,
.back-link:focus {
    outline: 3px solid rgba(22, 160, 133, 0.4);
    outline-offset: 2px;
}

/* Select Dropdown Styling */
select.form-input option {
    font-family: 'Work Sans', sans-serif;
    padding: 0.5rem;
}

/* Disabled State */
.form-input:disabled {
    background: rgba(0, 0, 0, 0.05);
    cursor: not-allowed;
    opacity: 0.6;
}

/* Print Styles */
@media print {
    body::before {
        display: none;
    }

    body {
        background: white;
    }

    .login-card {
        background: white;
        box-shadow: none;
        border: 1px solid #ddd;
    }

    .login-button,
    .back-link {
        display: none;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .form-input {
        border-width: 3px;
    }

    .login-button {
        border: 2px solid var(--teal-color);
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
