/* Traleos Login Plugin Styles */

.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
    overflow: hidden;
}

.login-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('../img/bg/login-bg.png') center/cover;
    opacity: 0.1;
    z-index: 1;
}

.login-wrapper {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 450px;
    margin: 20px;
}

.login-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #9162FF, #1C30A8);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo {
    width: 60px;
    height: 60px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, #9162FF, #1C30A8);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    font-weight: bold;
}

.login-title {
    font-size: 28px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 8px;
}

.login-subtitle {
    color: #6b7280;
    font-size: 14px;
}

.login-form {
    position: relative;
}

.form-group {
    margin-bottom: 20px;
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #374151;
    font-weight: 500;
    font-size: 14px;
}

.login-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: #f9fafb;
}

.login-input:focus {
    outline: none;
    border-color: #9162FF;
    background: white;
    box-shadow: 0 0 0 3px rgba(145, 98, 255, 0.1);
}

.password-wrapper {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: #6b7280;
    font-size: 16px;
    transition: color 0.3s ease;
}

.password-toggle:hover {
    color: #9162FF;
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    font-size: 14px;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 8px;
}

.remember-me input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #9162FF;
}

.forgot-password {
    color: #9162FF;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.forgot-password:hover {
    color: #7c3aed;
    text-decoration: underline;
}

.login-submit {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #9162FF, #1C30A8);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.login-submit:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(145, 98, 255, 0.3);
}

.login-submit:active:not(:disabled) {
    transform: translateY(0);
}

.login-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.login-submit.loading {
    color: transparent;
}

.loading-spinner {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    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: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

.login-message {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 500;
    display: none;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.login-message.show {
    opacity: 1;
    transform: translateY(0);
}

.login-message.error {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.login-message.success {
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}

.login-footer {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

.signup-link {
    color: #6b7280;
    font-size: 14px;
}

.signup-link a {
    color: #9162FF;
    text-decoration: none;
    font-weight: 500;
}

.signup-link a:hover {
    text-decoration: underline;
}

.demo-helper {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 8px;
    padding: 15px;
    margin-top: 20px;
    display: none;
}

.demo-helper h4 {
    color: #0369a1;
    font-size: 14px;
    margin-bottom: 10px;
    font-weight: 600;
}

.demo-credentials {
    font-size: 12px;
    color: #0284c7;
    line-height: 1.5;
}

.demo-credentials strong {
    color: #0c4a6e;
}

.demo-toggle {
    background: none;
    border: 1px solid #9162FF;
    color: #9162FF;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    margin-top: 15px;
    transition: all 0.3s ease;
}

.demo-toggle:hover {
    background: #9162FF;
    color: white;
}

/* Shake animation for failed login */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.login-form.shake {
    animation: shake 0.6s ease-in-out;
}

/* Responsive Design */
@media (max-width: 768px) {
    .login-wrapper {
        margin: 10px;
    }
    
    .login-card {
        padding: 30px 25px;
    }
    
    .login-title {
        font-size: 24px;
    }
    
    .form-options {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .login-card {
        padding: 25px 20px;
    }
    
    .login-title {
        font-size: 22px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .login-card {
        background: rgba(31, 41, 55, 0.95);
        border: 1px solid rgba(75, 85, 99, 0.3);
    }
    
    .login-title {
        color: #f9fafb;
    }
    
    .login-subtitle {
        color: #9ca3af;
    }
    
    .form-group label {
        color: #d1d5db;
    }
    
    .login-input {
        background: #374151;
        border-color: #4b5563;
        color: #f9fafb;
    }
    
    .login-input:focus {
        background: #4b5563;
        border-color: #9162FF;
    }
    
    .login-footer {
        border-top-color: #4b5563;
    }
    
    .signup-link {
        color: #9ca3af;
    }
}

/* Loading overlay */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.login-overlay.show {
    display: flex;
}

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