/* Login Page Styles */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    height: 100vh;
    overflow: hidden;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
}

/* Background Animation */
.background-animation {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 1;
}

.floating-icon {
    position: absolute;
    font-size: 3rem;
    opacity: 0.1;
    animation: float 15s infinite ease-in-out;
    pointer-events: none;
}

.floating-icon:nth-child(1) {
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.floating-icon:nth-child(2) {
    top: 20%;
    right: 20%;
    animation-delay: 3s;
}

.floating-icon:nth-child(3) {
    bottom: 30%;
    left: 15%;
    animation-delay: 6s;
}

.floating-icon:nth-child(4) {
    bottom: 10%;
    right: 10%;
    animation-delay: 9s;
}

.floating-icon:nth-child(5) {
    top: 50%;
    left: 5%;
    animation-delay: 12s;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    25% {
        transform: translateY(-20px) rotate(5deg);
    }
    50% {
        transform: translateY(-10px) rotate(-5deg);
    }
    75% {
        transform: translateY(-15px) rotate(3deg);
    }
}

/* Main Container */
.login-container {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 2;
    padding: 20px;
}

/* Login Card */
.login-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    width: 100%;
    max-width: 420px;
    padding: 40px;
    animation: slideIn 0.8s ease-out;
    position: relative;
    z-index: 10;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Header */
.login-header {
    text-align: center;
    margin-bottom: 40px;
}

.logo {
    font-size: 4rem;
    margin-bottom: 10px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.login-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 5px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    color: #666;
    font-size: 1rem;
    font-weight: 500;
}

/* Error Message */
.error-message {
    background: #ffebee;
    color: #c62828;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #ffcdd2;
    font-size: 0.9rem;
    font-weight: 500;
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Form */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

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

.form-label {
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-input {
    padding: 16px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
    position: relative;
    z-index: 5;
}

.form-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    transform: translateY(-2px);
}

.form-input::placeholder {
    color: #999;
}

.form-input:not([disabled]):not([readonly]) {
    pointer-events: auto;
    user-select: text;
    cursor: text;
}

/* Remember Me */
.remember-group {
    margin: 10px 0;
}

.remember-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.9rem;
    color: #666;
    user-select: none;
}

.remember-checkbox {
    margin-right: 10px;
    transform: scale(1.2);
    accent-color: #667eea;
}

/* Login Button */
.login-button {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 16px 24px;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    margin-top: 10px;
}

.login-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

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

.login-button:disabled {
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.button-text,
.button-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.button-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
}

.hidden {
    display: none !important;
}

/* Spinner */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Footer */
.login-footer {
    margin-top: 40px;
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.version-info {
    color: #666;
    font-size: 0.85rem;
    margin-bottom: 10px;
}

.health-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.9rem;
    color: #555;
}

.status-indicator {
    font-size: 1rem;
}

/* Responsive Design */
@media (max-width: 480px) {
    .login-card {
        padding: 30px 20px;
        margin: 10px;
        border-radius: 15px;
    }

    .login-header h1 {
        font-size: 2rem;
    }

    .logo {
        font-size: 3rem;
    }

    .form-input {
        padding: 14px 16px;
        font-size: 16px; /* Prevents zoom on iOS */
    }

    .floating-icon {
        font-size: 2rem;
    }
}

@media (max-height: 600px) {
    .login-card {
        padding: 20px;
    }

    .login-header {
        margin-bottom: 20px;
    }

    .logo {
        font-size: 2.5rem;
    }

    .login-header h1 {
        font-size: 1.8rem;
    }
}

/* Enhanced focus styles for accessibility */
.form-input:focus,
.login-button:focus,
.remember-checkbox:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .login-container {
        display: none;
    }
}

/* Dark mode support (if system prefers dark) */
@media (prefers-color-scheme: dark) {
    .login-card {
        background: rgba(30, 30, 30, 0.95);
        color: #fff;
    }

    .login-header h1 {
        color: #fff;
    }

    .subtitle {
        color: #ccc;
    }

    .form-label {
        color: #fff;
    }

    .form-input {
        background: rgba(255, 255, 255, 0.1);
        border-color: rgba(255, 255, 255, 0.2);
        color: #fff;
    }

    .form-input::placeholder {
        color: #aaa;
    }

    .login-footer {
        border-top-color: rgba(255, 255, 255, 0.2);
    }

    .version-info,
    .health-status {
        color: #ccc;
    }
}