/* Reset e configurações gerais */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
}

/* Container principal */
.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
    margin: 0 auto;
}

/* Card de login */
.login-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    padding: 40px 30px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea, #764ba2);
}

/* Cabeçalho */
.login-header h2 {
    color: #333;
    margin-bottom: 10px;
    font-size: 28px;
    font-weight: 600;
}

.login-header h2 i {
    color: #667eea;
    margin-right: 10px;
}

.login-header p {
    color: #666;
    margin-bottom: 30px;
    font-size: 16px;
}

/* Formulário */
.login-form {
    text-align: left;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 500;
    font-size: 14px;
}

.form-group label i {
    color: #667eea;
    margin-right: 8px;
    width: 16px;
}

.form-control {
    width: 100%;
    padding: 15px 18px;
    border: 2px solid #e0e6ed;
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.form-control:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Opções do formulário */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    font-size: 14px;
}

.remember-me {
    display: flex;
    align-items: center;
}

.remember-me input[type="checkbox"] {
    margin-right: 8px;
    transform: scale(1.1);
}

.remember-me label {
    margin-bottom: 0;
    color: #666;
    cursor: pointer;
}

.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: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
}

.btn-login:active {
    transform: translateY(0);
}

.btn-login i {
    margin-right: 8px;
}

/* Mensagens de alerta */
.alert {
    margin-top: 20px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
}

.alert.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Rodapé */
.login-footer {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e0e6ed;
}

.login-footer p {
    color: #666;
    font-size: 14px;
}

.login-footer a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.login-footer a:hover {
    color: #764ba2;
    text-decoration: underline;
}

/* Loading state para o botão */
.btn-login.loading {
    position: relative;
    color: transparent;
}

.btn-login.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsividade */
@media (max-width: 768px) {
    .login-container {
        padding: 10px;
        min-height: 100vh;
        justify-content: flex-start;
        padding-top: 20px;
    }
    
    .login-card {
        padding: 35px 25px;
        margin: 0;
        min-height: auto;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
        border-radius: 10px;
        width: 100%;
        max-width: 400px;
    }
    
    .login-header h2 {
        font-size: 26px;
        margin-bottom: 8px;
    }
    
    .login-header p {
        font-size: 14px;
        margin-bottom: 25px;
    }
    
    .form-group {
        margin-bottom: 18px;
    }
    
    .form-group label {
        font-size: 14px;
        margin-bottom: 6px;
    }
    
    .form-control {
        padding: 14px 16px;
        font-size: 16px; /* Prevenir zoom no iOS */
        border-radius: 10px;
    }
    
    .form-options {
        margin-bottom: 20px;
        font-size: 13px;
    }
    
    .btn-login {
        padding: 16px;
        font-size: 15px;
        border-radius: 10px;
    }
    
    .alert {
        margin-top: 15px;
        padding: 10px 14px;
        font-size: 13px;
        border-radius: 6px;
    }
    
    .login-footer {
        margin-top: 25px;
        padding-top: 15px;
    }
    
    .login-footer p {
        font-size: 13px;
        text-align: center;
    }
}

@media (max-width: 576px) {
    .login-container {
        padding: 5px;
        padding-top: 15px;
    }
    
    .login-card {
        padding: 30px 20px;
        border-radius: 8px;
        width: 100%;
        max-width: 100%;
        margin: 0 5px;
    }
    
    .login-header h2 {
        font-size: 24px;
        text-align: center;
    }
    
    .login-header p {
        font-size: 13px;
        text-align: center;
        margin-bottom: 20px;
    }
    
    .form-group {
        margin-bottom: 16px;
    }
    
    .form-control {
        padding: 12px 14px;
        font-size: 15px;
    }
    
    .form-options {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
        margin-bottom: 18px;
        font-size: 12px;
    }
    
    .remember-me {
        align-self: flex-start;
    }
    
    .forgot-password {
        align-self: flex-end;
    }
    
    .btn-login {
        padding: 14px;
        font-size: 14px;
        letter-spacing: 0.3px;
    }
    
    .login-footer {
        margin-top: 20px;
        padding-top: 12px;
    }
    
    .login-footer p {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .login-container {
        padding: 2px;
        padding-top: 10px;
    }
    
    .login-card {
        padding: 25px 18px;
        margin: 0 2px;
    }
    
    .login-header h2 {
        font-size: 22px;
    }
    
    .login-header h2 i {
        font-size: 20px;
        margin-right: 8px;
    }
    
    .form-control {
        padding: 11px 12px;
        font-size: 16px; /* Evita zoom no iOS */
    }
    
    .btn-login {
        padding: 13px;
        font-size: 13px;
    }
}

/* Landscape mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .login-container {
        padding: 10px;
        padding-top: 5px;
    }
    
    .login-card {
        padding: 20px;
        max-width: 450px;
    }
    
    .login-header h2 {
        font-size: 20px;
        margin-bottom: 5px;
    }
    
    .login-header p {
        font-size: 12px;
        margin-bottom: 15px;
    }
    
    .form-group {
        margin-bottom: 12px;
    }
    
    .form-control {
        padding: 10px 12px;
    }
    
    .form-options {
        margin-bottom: 15px;
        flex-direction: row;
        font-size: 11px;
    }
    
    .btn-login {
        padding: 12px;
        font-size: 13px;
    }
    
    .login-footer {
        margin-top: 15px;
        padding-top: 10px;
    }
}

/* Melhorias para touch devices */
@media (hover: none) and (pointer: coarse) {
    .form-control {
        min-height: 44px; /* Mínimo recomendado para touch */
    }
    
    .btn-login {
        min-height: 48px;
        touch-action: manipulation;
    }
    
    .remember-me input[type="checkbox"] {
        transform: scale(1.3);
        margin-right: 10px;
    }
    
    .forgot-password {
        padding: 8px;
        margin: -8px;
    }
    
    /* Melhorar feedback visual para touch */
    .btn-login:active {
        transform: scale(0.98);
        transition: transform 0.1s ease;
    }
    
    .form-control:focus {
        outline: 3px solid #667eea;
        outline-offset: 2px;
    }
}

/* Animações */
.login-card {
    animation: slideUp 0.6s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Estados de erro nos campos */
.form-control.error {
    border-color: #dc3545;
    background-color: #fff5f5;
}

.form-control.error:focus {
    border-color: #dc3545;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

/* Acessibilidade e melhorias adicionais */
@media (prefers-reduced-motion: reduce) {
    .login-card {
        animation: none;
    }
    
    .btn-login:hover {
        transform: none;
    }
    
    .btn-login.loading::after {
        animation: none;
    }
}
