/* ============================================
   LOGIN PAGE - Layout Minimalista Split Screen
   ============================================ */

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

:root {
    --primary-color: #27ae60;
    --primary-hover: #229954;
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --border-color: #dee2e6;
    --bg-white: #ffffff;
    --bg-light: #f8f9fa;
    --error-color: #dc3545;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.15);
}

body.login-body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-light);
    overflow: hidden;
    height: 100vh;
}

/* ============================================
   LAYOUT SPLIT SCREEN
   ============================================ */

.login-split {
    display: flex;
    height: 100vh;
    width: 100%;
}

/* ============================================
   LADO ESQUERDO - IMAGEM
   ============================================ */

.login-left {
    flex: 0 0 70%;
    position: relative;
    overflow: hidden;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-background-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.login-left::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(39,174,96,0.45) 0%, rgba(39,174,96,0.25) 40%, rgba(39,174,96,0.1) 70%, rgba(39,174,96,0.0) 100%);
}

/* ============================================
   LADO DIREITO - FORMULÁRIO
   ============================================ */

.login-right {
    flex: 0 0 30%;
    min-width: 480px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-white);
    padding: 60px 48px;
    overflow-y: auto;
}

.login-container {
    width: 100%;
    max-width: 520px;
}

.login-card {
    background: var(--bg-white);
    padding: 0;
}

/* ============================================
   HEADER (Logo e Título)
   ============================================ */

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

.login-title {
    display: none;
}

.login-logo {
    display: block;
    margin: 0 auto 12px auto;
    width: 220px;
    max-width: 80%;
    height: auto;
}

.logo-text {
    font-weight: 700;
    color: var(--text-primary);
}

.logo-o {
    color: var(--primary-color);
}

.login-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    font-weight: 500;
    text-align: center;
}

/* ============================================
   FORMULÁRIO
   ============================================ */

.login-form { width: 100%; }

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

.form-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"] {
    width: 100%;
    padding: 14px 16px;
    font-size: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    transition: all 0.2s;
    background: var(--bg-white);
    color: var(--text-primary);
    font-family: inherit;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(39, 174, 96, 0.1);
}

.form-group input::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

/* Password Input com Toggle */
.password-input {
    position: relative;
}

.password-input input { padding-right: 45px; }

.toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.toggle-password:hover {
    color: var(--text-primary);
}

.toggle-password:focus {
    outline: none;
}

/* ============================================
   OPÇÕES (Lembrar-me e Esqueci senha)
   ============================================ */

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

.checkbox-container {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.checkbox-container input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 8px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.checkbox-container .checkmark {
    display: none; /* Usando checkbox nativo do navegador */
}

.forgot-password {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.forgot-password:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* ============================================
   BOTÃO DE LOGIN
   ============================================ */

.btn-login {
    width: 100%;
    padding: 16px 24px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--bg-white);
    background: var(--primary-color);
    border: none;
    border-radius: 24px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    margin-bottom: 0;
}

.btn-login:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

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

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

/* ============================================
   LOADING OVERLAY
   ============================================ */

.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    z-index: 9999;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.loading-overlay.active {
    display: flex;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--bg-light);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

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

.loading-overlay p {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* ============================================
   ERROR MESSAGE
   ============================================ */

.error-message {
    display: none;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: #fee;
    border: 1px solid #fcc;
    border-radius: 6px;
    color: var(--error-color);
    font-size: 0.9rem;
    margin-top: 16px;
}

.error-message.active {
    display: flex;
}

.error-message i {
    font-size: 1.1rem;
}

/* ============================================
   RESPONSIVIDADE
   ============================================ */

@media (max-width: 1024px) {
    .login-split { flex-direction: column; }
    .login-left { flex: 0 0 40%; min-height: 340px; }
    .login-right { flex: 1; min-width: 100%; padding: 32px 24px; }
}

@media (max-width: 768px) {
    .login-left { display: none; }
    .login-right { padding: 24px; }
    .login-title { font-size: 2.4rem; }
    .login-container { max-width: 100%; }
}

@media (max-width: 480px) {
    .login-title {
        font-size: 1.75rem;
    }
    
    .login-subtitle {
        font-size: 0.9rem;
    }
    
    .form-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
}
