/* ========================================
   LOGIN PAGE - DESIGN PREMIUM CLÁSSICO
======================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', sans-serif;
    background: #f8f9fa;
    height: 100vh;
    overflow: hidden;
}

.login-container {
    display: flex;
    height: 100vh;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.1);
}

/* ========================================
   LEFT PANEL - BRANDING
======================================== */

.login-brand {
    flex: 1;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.login-brand::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--tenant-accent, #d4af37) 0%, var(--tenant-accent-light, #f1d366) 100%);
    opacity: 0.1;
    z-index: 1;
}

.brand-content {
    text-align: center;
    color: white;
    z-index: 2;
    position: relative;
    max-width: 400px;
    padding: 2rem;
}

.logo-section {
    margin-bottom: 3rem;
}

.brand-logo {
    width: 80px;
    height: 80px;
    margin-bottom: 1rem;
    filter: brightness(0) invert(1);
}

.brand-content h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--tenant-accent, #d4af37);
    margin-bottom: 0.5rem;
}

.brand-description h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #ffffff;
}

.brand-description p {
    font-size: 1rem;
    color: #cccccc;
    margin-bottom: 2rem;
    line-height: 1.6;
}

.features-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: #ffffff;
}

.feature-item i {
    color: var(--tenant-accent, #d4af37);
    font-size: 1.2rem;
    width: 20px;
}

/* ========================================
   RIGHT PANEL - LOGIN FORM
======================================== */

.login-form-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    padding: 2rem;
}

.login-form {
    width: 100%;
    max-width: 400px;
}

.form-header {
    text-align: center;
    margin-bottom: 2rem;
}

.form-header h2 {
    font-size: 1.8rem;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 0.5rem;
}

.form-header p {
    color: #666;
    font-size: 0.9rem;
}

/* ========================================
   FORM ELEMENTS
======================================== */

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    color: #333;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.form-label i {
    color: var(--tenant-accent, #d4af37);
    font-size: 0.9rem;
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #ffffff;
    color: #333;
}

.form-input:focus {
    outline: none;
    border-color: var(--tenant-accent, #d4af37);
    box-shadow: 0 0 0 3px rgba(var(--tenant-accent-rgb, 212, 175, 55), 0.1);
}

.form-input.error {
    border-color: #dc3545;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

.form-input.success {
    border-color: #28a745;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.1);
}

select.form-input {
    cursor: pointer;
    appearance: auto;
}

select.form-input option {
    background: #ffffff;
    color: #333;
}

/* Password Input */
.password-input-container {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: color 0.3s ease;
}

.password-toggle:hover {
    color: var(--tenant-accent, #d4af37);
}

/* Error Messages */
.error-message {
    color: #dc3545;
    font-size: 0.8rem;
    margin-top: 0.25rem;
    display: none;
}

.error-message.show {
    display: block;
}

/* Form Options */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.checkbox-container {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.9rem;
    color: #666;
}

.checkbox-container input {
    display: none;
}

.checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid #e1e5e9;
    border-radius: 4px;
    margin-right: 0.5rem;
    position: relative;
    transition: all 0.3s ease;
}

.checkbox-container input:checked + .checkmark {
    background: var(--tenant-accent, #d4af37);
    border-color: var(--tenant-accent, #d4af37);
}

.checkbox-container input:checked + .checkmark::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 0.8rem;
    font-weight: bold;
}

.forgot-password {
    color: var(--tenant-accent, #d4af37);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.forgot-password:hover {
    color: #b38b30;
    text-decoration: underline;
}

/* Login Button */
.login-button {
    width: 100%;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, var(--tenant-accent, #d4af37) 0%, var(--tenant-accent-light, #f1d366) 100%);
    color: #1a1a1a;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.login-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(var(--tenant-accent-rgb, 212, 175, 55), 0.3);
}

.login-button:active {
    transform: translateY(0);
}

.login-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.button-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

/* Form Messages */
.form-message {
    margin-top: 1rem;
    padding: 0.75rem;
    border-radius: 8px;
    font-size: 0.9rem;
    text-align: center;
}

.form-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.form-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

/* Footer */
.login-footer {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e1e5e9;
}

.login-footer p {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.login-footer a {
    color: var(--tenant-accent, #d4af37);
    text-decoration: none;
    transition: color 0.3s ease;
}

.login-footer a:hover {
    color: #b38b30;
    text-decoration: underline;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #666;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.back-link:hover {
    color: var(--tenant-accent, #d4af37);
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-spinner {
    text-align: center;
    color: white;
}

.loading-spinner i {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--tenant-accent, #d4af37);
}

.loading-spinner p {
    font-size: 1rem;
}

/* ========================================
   RESPONSIVE DESIGN
======================================== */

@media (max-width: 768px) {
    .login-container {
        flex-direction: column;
        overflow-y: auto;
    }
    
    .login-brand {
        flex: none;
        min-height: 200px;
    }
    
    .brand-content {
        padding: 1rem;
    }
    
    .brand-content h1 {
        font-size: 1.8rem;
    }
    
    .brand-description h2 {
        font-size: 1.2rem;
    }
    
    .features-list {
        display: none;
    }
    
    .login-form-container {
        flex: none;
        padding: 1rem;
    }
    
    .form-options {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .login-form-container {
        padding: 0.5rem;
    }
    
    .login-form {
        max-width: 100%;
    }
}

/* ========================================
   AUTH MESSAGES
======================================== */

.auth-message {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    animation: slideIn 0.3s ease;
}

.auth-message-error {
    background: rgba(220, 53, 69, 0.1);
    border: 1px solid rgba(220, 53, 69, 0.3);
    color: #dc3545;
}

.auth-message-success {
    background: rgba(40, 167, 69, 0.1);
    border: 1px solid rgba(40, 167, 69, 0.3);
    color: #28a745;
}

.auth-message-info {
    background: rgba(23, 162, 184, 0.1);
    border: 1px solid rgba(23, 162, 184, 0.3);
    color: #17a2b8;
}

.auth-message i {
    font-size: 1rem;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Loading state for submit button */
.login-submit.loading {
    opacity: 0.7;
    cursor: not-allowed;
}

.login-submit.loading .btn-text {
    display: none;
}

.login-submit.loading .btn-loader {
    display: inline-flex !important;
    align-items: center;
    gap: 0.5rem;
}