@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
    --mfr-green: #008248;
    --mfr-green-dark: #006638;
    --mfr-green-light: #eaf1ed;
    --mfr-orange: #FF7F00;
    --mfr-orange-hover: #e06f00;
    --mfr-bg: #f5f7f6;
    --mfr-white: #ffffff;
    --mfr-text: #2d3436;
    --mfr-muted: #636e72;
    --mfr-border: #dfe6e9;
    --mfr-radius: 12px;
    
    /* Cores de erro */
    --danger-color: #dc3545;
    --danger-bg: rgba(220, 53, 69, 0.1);
}

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

body, html {
    height: 100%;
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: var(--mfr-bg);
    color: var(--mfr-text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    position: relative;
    background: radial-gradient(circle at 10% 20%, rgba(0, 130, 72, 0.04) 0%, transparent 45%),
                radial-gradient(circle at 90% 80%, rgba(255, 127, 0, 0.04) 0%, transparent 45%),
                var(--mfr-bg);
}

/* O Box principal de Login estilo Split */
.login-card {
    width: 100%;
    max-width: 960px;
    min-height: 560px;
    background: var(--mfr-white);
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.06), 0 5px 15px rgba(0, 0, 0, 0.02);
    display: flex;
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px);
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.6s ease;
}

/* Painel Esquerdo (Logo e Branding) */
.brand-panel {
    flex: 1.1;
    background-color: var(--mfr-green);
    padding: 3.5rem 3rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: var(--mfr-white);
    position: relative;
    background-image: radial-gradient(circle at 0% 0%, rgba(255, 255, 255, 0.12) 0%, transparent 50%),
                      radial-gradient(circle at 100% 100%, rgba(255, 127, 0, 0.15) 0%, transparent 60%);
}

.brand-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 100%;
}

.brand-logo {
    max-width: 190px;
    height: auto;
    margin-bottom: 2.5rem;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.1));
}

.brand-title {
    font-size: 2.2rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1rem;
    letter-spacing: -0.5px;
}

.brand-text {
    font-size: 1rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 500;
}

.brand-footer {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 500;
    letter-spacing: 0px;
    text-transform: none;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1.5rem;
    margin-top: 2rem;
}

/* Painel Direito (Formulário) */
.form-panel {
    flex: 1;
    padding: 4rem 3.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background-color: var(--mfr-white);
}

.form-content {
    width: 100%;
}

.form-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--mfr-text);
    margin-bottom: 0.5rem;
    letter-spacing: -0.5px;
}

.form-subtitle {
    font-size: 0.95rem;
    color: var(--mfr-muted);
    margin-bottom: 2.5rem;
    font-weight: 500;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    position: relative;
}

.form-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--mfr-text);
}

.form-input {
    width: 100%;
    padding: 0.85rem 1rem;
    border: 1.5px solid var(--mfr-border);
    border-radius: var(--mfr-radius);
    font-size: 0.95rem;
    color: var(--mfr-text);
    background-color: #fafafa;
    outline: none;
    transition: all 0.2s ease;
    font-family: inherit;
}

.form-input:focus {
    border-color: var(--mfr-green);
    background-color: var(--mfr-white);
    box-shadow: 0 0 0 3px rgba(0, 130, 72, 0.1);
}

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

/* Validações */
.form-input.error {
    border-color: var(--danger-color);
}

.form-input.error:focus {
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.15);
}

.error-message {
    color: var(--danger-color);
    font-size: 0.8rem;
    font-weight: 600;
    margin-top: 0.25rem;
    display: none;
}

.error-message.show {
    display: block;
}

/* Ações e Extras */
.form-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.5rem;
    margin-bottom: 1.5rem;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--mfr-muted);
    font-weight: 500;
    cursor: pointer;
}

.remember-me input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--mfr-green);
    cursor: pointer;
}

.forgot-password {
    font-size: 0.875rem;
    color: var(--mfr-green);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.forgot-password:hover {
    color: var(--mfr-orange);
}

/* Botão de Login */
.login-button {
    width: 100%;
    padding: 1rem;
    border: none;
    border-radius: var(--mfr-radius);
    background: var(--mfr-green);
    color: var(--mfr-white);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.login-button:hover {
    background-color: var(--mfr-green-dark);
    box-shadow: 0 8px 20px rgba(0, 130, 72, 0.2);
}

.login-button:active {
    transform: scale(0.98);
}

/* Estado de Carregamento */
.login-button.loading {
    pointer-events: none;
    color: transparent;
}

.login-button.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 3px solid transparent;
    border-top: 3px solid var(--mfr-white);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Flash Messages */
.flash-messages {
    margin-bottom: 1.5rem;
}

.flash {
    padding: 0.85rem 1rem;
    border-radius: 8px;
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
    font-weight: 600;
    border: 1px solid transparent;
}

.flash-success {
    background-color: #eaf1ed;
    border-color: rgba(0, 130, 72, 0.2);
    color: var(--mfr-green);
}

.flash-error {
    background-color: var(--danger-bg);
    border-color: rgba(220, 53, 69, 0.2);
    color: var(--danger-color);
}

.flash-info {
    background-color: #e1f5fe;
    border-color: rgba(9, 132, 227, 0.2);
    color: #0984e3;
}

/* Rodapé em telas menores */
.mobile-footer {
    display: none;
    margin-top: 2rem;
    text-align: center;
    color: var(--mfr-muted);
    font-size: 0.8rem;
    line-height: 1.4;
    width: 100%;
}

/* Responsividade */
@media (max-width: 900px) {
    .login-card {
        max-width: 480px;
        flex-direction: column;
        min-height: auto;
    }
    
    .brand-panel {
        padding: 2.5rem 2rem;
        text-align: center;
        align-items: center;
    }
    
    .brand-content {
        align-items: center;
    }
    
    .brand-logo {
        margin-bottom: 1rem;
        max-width: 150px;
    }
    
    .brand-title {
        font-size: 1.75rem;
        margin-bottom: 0.5rem;
    }
    
    .brand-text {
        font-size: 0.9rem;
    }
    
    .brand-footer {
        display: none; /* Escondido em colapso */
    }
    
    .form-panel {
        padding: 3rem 2rem;
    }
    
    .form-subtitle {
        margin-bottom: 1.75rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0.75rem;
    }
    
    .login-card {
        border-radius: 16px;
    }
    
    .brand-panel {
        padding: 2rem 1.5rem;
    }
    
    .brand-title {
        font-size: 1.5rem;
    }
    
    .form-panel {
        padding: 2rem 1.5rem;
    }
    
    .form-actions {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
        margin-bottom: 1.25rem;
    }
}

/* Eye icon for password toggling */
.password-container {
    position: relative;
    width: 100%;
}

.password-container .form-input {
    padding-right: 2.75rem !important;
}

.eye-toggle {
    position: absolute;
    right: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: var(--mfr-muted);
    transition: color 0.2s ease;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    padding: 0.25rem;
}

.eye-toggle:hover {
    color: var(--mfr-green);
}
