/**
 * CRAM - Sistema de Gerenciamento
 * Estilos da Página de Login
 *
 * Alinhado com Design System:
 * - Paleta institucional roxo/rosa/azul
 * - Suporte a dark mode
 * - Acessibilidade WCAG AA
 * - Iconografia padronizada
 */

/* ========================================
   Container Principal
   ======================================== */

.login-container {
    min-height: 100vh;
    background-image: url('/assets/img/login-bg.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 20px;
    padding-right: 60px;
}

/* ========================================
   Card de Login
   ======================================== */

.login-card {
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(139, 91, 191, 0.2);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(139, 91, 191, 0.25), 0 0 0 1px rgba(139, 91, 191, 0.1);
    overflow: hidden;
    max-width: 450px;
    width: 100%;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.login-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 25px 70px rgba(139, 91, 191, 0.35), 0 0 0 1px rgba(139, 91, 191, 0.15);
}

/* ========================================
   Header do Card
   ======================================== */

.login-header {
    background: linear-gradient(135deg, #8B5BBF 0%, #7C72A0 100%);
    color: white;
    padding: 40px 30px 30px;
    text-align: center;
    position: relative;
}

.login-header::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, #B8B0D9, #8B5BBF);
    border-radius: 2px;
}

/* Logo */
.login-header .login-logo {
    max-width: 180px;
    height: auto;
    opacity: 0.95;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.login-header .login-logo:hover {
    opacity: 1;
    transform: scale(1.05);
}

/* Manter compatibilidade com ícones Font Awesome (se necessário) */
.login-header i.fa-3x {
    font-size: 36px;
    opacity: 0.9;
}

.login-header h2 {
    font-size: 14.5px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: white !important;
}

.login-header p {
    font-size: 10.5px;
    opacity: 0.85;
    margin-top: 8px;
}

/* ========================================
   Body do Card
   ======================================== */

.login-body {
    padding: 40px 30px 30px;
}

/* ========================================
   Formulário - Alinhamento de Ícones
   ======================================== */

.login-body .form-label {
    font-weight: 600;
    color: #2E2545;
    margin-bottom: 8px;
    font-size: 10.5px;
}

.login-body .input-group {
    margin-bottom: 0;
}

/* Ícone no input-group-text */
.login-body .input-group-text {
    background: rgba(184, 176, 217, 0.15);
    border: 1px solid #7C72A0;
    border-right: none;
    border-radius: 8px 0 0 8px;
    padding: 0 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
}

.login-body .input-group-text i {
    font-size: 11.25px; /* Tamanho padrão .icon-md */
    color: #8B5BBF;
    line-height: 1;
}

/* Input com ícone */
.login-body .form-control.with-icon {
    border-left: none;
    border-radius: 0;
    border: 1px solid #7C72A0;
    padding: 12px 16px;
    font-size: 11.25px;
    height: 48px; /* Altura fixa para alinhamento */
    line-height: 1.5;
    background: rgba(255, 255, 255, 0.9);
    color: #2E2545;
}

.login-body .form-control.with-icon:focus {
    border-color: #8B5BBF;
    box-shadow: none;
    outline: none;
}

/* Botão de toggle senha */
.login-body .btn-outline-secondary {
    border: 1px solid #7C72A0;
    border-left: none;
    border-radius: 0 8px 8px 0;
    padding: 0 14px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(184, 176, 217, 0.2);
    color: #8B5BBF;
    transition: background 0.2s ease, color 0.2s ease;
}

.login-body .btn-outline-secondary:hover {
    background: rgba(184, 176, 217, 0.3);
    color: #2E2545;
    border-color: #8B5BBF;
}

.login-body .btn-outline-secondary i {
    font-size: 13.5px;
    line-height: 1;
}

/* Focus no input-group completo */
.login-body .input-group:focus-within .input-group-text {
    border-color: #8B5BBF;
    background: rgba(139, 91, 191, 0.1);
}

.login-body .input-group:focus-within .btn-outline-secondary {
    border-color: #8B5BBF;
}

/* ========================================
   Botão de Login
   ======================================== */

.btn-login {
    background: linear-gradient(135deg, #8B5BBF 0%, #7C72A0 100%);
    border: none;
    border-radius: 8px;
    padding: 14px 24px;
    width: 100%;
    color: white;
    font-weight: 600;
    font-size: 12px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 12px rgba(139, 91, 191, 0.4);
}

.btn-login:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(139, 91, 191, 0.5);
    background: linear-gradient(135deg, #2E2545 0%, #8B5BBF 100%);
}

.btn-login:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(139, 91, 191, 0.4);
}

.btn-login:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* ========================================
   Alertas
   ======================================== */

.login-body .alert {
    border-radius: 8px;
    border: none;
    font-size: 10.5px;
    padding: 12px 16px;
    margin-bottom: 20px;
}

.login-body .alert-danger {
    background: #FEE2E2;
    color: #991B1B;
}

.login-body .alert-success {
    background: #D1FAE5;
    color: #065F46;
}

/* ========================================
   Acessibilidade - Focus States
   ======================================== */

.login-body .form-control:focus-visible,
.login-body .btn-login:focus-visible,
.login-body .btn-outline-secondary:focus-visible {
    outline: 3px solid #8B5BBF;
    outline-offset: 2px;
}

/* ========================================
   Responsividade Mobile
   ======================================== */

@media (max-width: 576px) {
    .login-container {
        padding: 15px;
        padding-right: 15px; /* Resetar padding direita */
        justify-content: center; /* Centralizar em mobile */
        background-attachment: scroll; /* Melhor performance em mobile */
    }

    .login-card {
        border-radius: 12px;
    }

    .login-header {
        padding: 30px 20px 25px;
    }

    .login-header .login-logo {
        max-width: 130px;
    }

    .login-header i.fa-3x {
        font-size: 30px;
    }

    .login-header h2 {
        font-size: 13.5px;
        color: white !important;
    }

    .login-header p {
        font-size: 9.75px;
    }

    .login-body {
        padding: 30px 20px 25px;
    }

    .login-body .form-label {
        font-size: 9.75px;
    }

    .login-body .input-group-text {
        min-width: 44px;
        padding: 0 12px;
    }

    .login-body .input-group-text i {
        font-size: 13.5px;
    }

    .login-body .form-control.with-icon {
        font-size: 10.5px;
        height: 44px;
        padding: 10px 14px;
    }

    .login-body .btn-outline-secondary {
        height: 44px;
        padding: 0 12px;
    }

    .btn-login {
        padding: 12px 20px;
        font-size: 11.25px;
    }
}

/* ========================================
   Impressão (ocultar)
   ======================================== */

@media print {
    .login-container {
        display: none;
    }
}
