/* Reset e Estilos Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* Container Principal */
.login-container {
    width: 100%;
    max-width: 400px;
}

/* Card de Login */
.login-card {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    animation: slideUp 0.6s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Header do Login */
.login-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px 30px 30px;
    text-align: center;
}

.logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 10px;
}

.logo img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    margin-bottom: 15px;
    border: 3px solid rgba(255, 255, 255, 0.3);
}

.logo h1 {
    font-size: 24px;
    font-weight: 700;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.subtitle {
    font-size: 14px;
    opacity: 0.9;
    margin: 0;
}

/* Formulário de Login */
.login-form {
    padding: 40px 30px;
}

.form-group {
    margin-bottom: 25px;
}

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

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

.input-icon {
    position: absolute;
    left: 15px;
    font-size: 18px;
    color: #999;
    z-index: 1;
}

.form-group input {
    width: 100%;
    padding: 15px 15px 15px 45px;
    border: 2px solid #e1e8ed;
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

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

.form-group input.error {
    border-color: #e74c3c;
    background: #fdf2f2;
}

.toggle-password {
    position: absolute;
    right: 15px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    color: #999;
    transition: color 0.3s ease;
    z-index: 1;
}

.toggle-password:hover {
    color: #667eea;
}

.error-message {
    display: block;
    color: #e74c3c;
    font-size: 12px;
    margin-top: 5px;
    animation: shake 0.5s ease-in-out;
}

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

/* Opções do Formulário */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    font-size: 14px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    color: #666;
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid #ddd;
    border-radius: 4px;
    margin-right: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
    background: #667eea;
    border-color: #667eea;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
    content: '✓';
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.forgot-password {
    color: #667eea;
    text-decoration: none;
    transition: color 0.3s ease;
}

.forgot-password:hover {
    color: #764ba2;
    text-decoration: underline;
}

/* Botão de Login */
.btn-login {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

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

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

.btn-login:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-loading {
    display: flex;
    align-items: center;
    justify-content: center;
}

.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;
    margin-right: 10px;
}

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

/* Alertas */
.alert {
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert-error {
    background: #fdf2f2;
    color: #e74c3c;
    border: 1px solid #f5c6cb;
}

/* Footer do Login */
.login-footer {
    background: #f8f9fa;
    padding: 20px 30px;
    text-align: center;
    border-top: 1px solid #e1e8ed;
}

.login-footer p {
    color: #999;
    font-size: 12px;
    margin: 5px 0;
}

/* Responsividade */
@media (max-width: 480px) {
    .login-container {
        margin: 20px;
    }
    
    .login-card {
        border-radius: 15px;
    }
    
    .login-header {
        padding: 30px 20px 20px;
    }
    
    .login-form {
        padding: 30px 20px;
    }
    
    .form-options {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .logo h1 {
        font-size: 20px;
    }
}

/* Animações de entrada */
.login-card {
    animation: slideUp 0.6s ease-out;
}

/* Estados de hover e focus para melhor UX */
.form-group input:hover {
    border-color: #ccc;
    background: white;
}

.btn-login:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.3);
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    body {
        background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
    }
    
    .login-card {
        background: #2d3748;
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    }
    
    .form-group label {
        color: #e2e8f0;
    }
    
    .form-group input {
        background: #4a5568;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .form-group input:focus {
        background: #2d3748;
        border-color: #667eea;
    }
    
    .checkbox-label {
        color: #a0aec0;
    }
    
    .checkmark {
        border-color: #4a5568;
    }
    
    .login-footer {
        background: #4a5568;
        border-top-color: #2d3748;
    }
    
    .login-footer p {
        color: #718096;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .login-card {
        border: 2px solid #000;
    }
    
    .form-group input {
        border-width: 2px;
    }
    
    .btn-login {
        border: 2px solid #000;
    }
}

/* Redução de movimento para acessibilidade */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
