/* Reset e configurações globais */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body, html {
    height: 100%;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    overflow: hidden;
}

/* Remove padding-top do base.css na página de login */
body {
    padding-top: 0 !important;
    background-color: transparent !important;
}

/* Container principal com imagem de fundo */
.login-container {
    min-height: 100vh;
    /* Fallback gradient caso a imagem não carregue */
    background: linear-gradient(135deg, #2c2c2c 0%, #1a1a1a 40%, #4a5c3a 100%);
    /* Imagem de fundo principal */
    background: url('../images/fundo.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
}

/* Overlay sutil para melhorar contraste se necessário */
.login-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.1);
    pointer-events: none;
    z-index: var(--z-index-background);
}

/* Layout principal com duas colunas */
.login-layout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 60px;
    max-width: 1400px;
    width: 100%;
    position: relative;
    z-index: var(--z-index-product-manufacturer);
}

/* Coluna do login */
.login-column {
    flex: 0 0 auto;
}

/* Coluna da imagem */
.image-column {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-container {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeInRight 0.8s ease-out 0.3s both;
}

.side-image {
    max-width: 650px;
    max-height: 500px;
    width: auto;
    height: auto;
    filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.3));
    transition: all 0.3s ease;
}

.side-image:hover {
    transform: scale(1.02);
    filter: drop-shadow(0 12px 32px rgba(0, 0, 0, 0.4));
}

/* Card de login */
.login-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 24px;
    padding: 35px;
    width: 450px;
    min-height: 480px;
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.1),
        0 10px 20px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: fadeInLeft 0.8s ease-out both;
    position: relative;
    z-index: var(--z-index-product-manufacturer);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Header do card */
.card-header {
    padding-bottom: 20px;
    padding-top: 10px;
    border-radius: 6px 6px 0 0;
    position: relative;
    background-color: #f5f5f4;
    border-bottom: 0px;
}

.welcome-section {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 0;
}

.header-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #d3f43b, #c4e834);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 
        0 4px 12px rgba(211, 244, 59, 0.3),
        0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.header-icon:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 8px 20px rgba(211, 244, 59, 0.4),
        0 4px 8px rgba(0, 0, 0, 0.15);
}

.login-icon {
    font-size: 1.5rem;
    color: #2c2c2c;
    font-weight: 600;
}

.header-text {
    flex: 1;
    text-align: left;
}

.card-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 6px 0;
    letter-spacing: -0.5px;
    line-height: 1.2;
}

.card-subtitle {
    font-size: 1rem;
    color: #6b7280;
    margin: 0;
    font-weight: 400;
    line-height: 1.4;
}

/* Formulário */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-label {
    font-size: 0.9rem;
    font-weight: 500;
    color: #4a4a4a;
    margin-bottom: 8px;
}

.form-control {
    padding: 14px 18px;
    border: 2px solid #e1e5e9;
    border-radius: 12px;
    font-size: 0.9rem;
    background: #ffffff;
    transition: all 0.3s ease;
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: #d3f43b;
    box-shadow: 0 0 0 3px rgba(211, 244, 59, 0.1);
    background: #ffffff;
}

.form-control::placeholder {
    color: #a0a0a0;
}

/* Container da senha */
.password-container {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.password-toggle:hover {
    color: #d3f43b;
    background: rgba(211, 244, 59, 0.1);
}

/* Botão de login */
.btn-login {
    background: #d3f43b;
    border: none;
    padding: 14px 22px;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c2c2c;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    margin-top: 8px;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(211, 244, 59, 0.4);
    background: #c4e834;
}

.btn-login:active {
    transform: translateY(0);
}

.btn-login:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Loading state do botão */
.btn-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(44, 44, 44, 0.3);
    border-top: 2px solid #2c2c2c;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Modal moderno */
.modern-modal {
    border-radius: 20px;
    border: none;
    overflow: hidden;
}

/* Z-index do modal de erro */
#errorModal .modal-dialog {
    z-index: var(--z-index-modal);
}

.modern-modal .modal-header {
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
    color: white;
    border: none;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.error-icon {
    font-size: 1.5rem;
}

.modern-modal .modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
}

.modern-modal .modal-body {
    padding: 24px;
    background: #ffffff;
}

.error-message {
    margin: 0;
    color: #4a4a4a;
    font-size: 1rem;
    line-height: 1.5;
}

.modern-modal .modal-footer {
    background: #f8f9fa;
    border: none;
    padding: 20px 24px;
}

.modern-btn {
    border-radius: 8px;
    padding: 10px 20px;
    font-weight: 500;
}

/* Overlay global */
.global-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: var(--z-index-modal-backdrop);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.global-overlay.show {
    visibility: visible;
}

/* Animações */
@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Estados de validação */
.form-control.is-invalid {
    border-color: #dc3545;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

.form-control.is-valid {
    border-color: #28a745;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.1);
}

/* Melhorias de acessibilidade */
.form-control:focus-visible {
    outline: 2px solid #d3f43b;
    outline-offset: 2px;
}

.btn-login:focus-visible {
    outline: 2px solid #d3f43b;
    outline-offset: 2px;
}

/* Transições suaves para todos os elementos interativos */
* {
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

/* ==================== MOBILE-LOGIN ==================== */

@media (max-width: 1100px) {
    /* iPad Mini Horizontal e Tablets - Reduzir tamanhos mas manter lado a lado */
    .login-layout {gap: 20px; max-width: 900px; padding: 0 15px;}
    .login-card {width: 380px; padding: 28px; min-height: 420px;}
    .side-image {max-width: 380px; max-height: 320px;}
}

/* Layout Mobile - Stack Vertical */
@media (max-width: 768px) {
    .login-container {padding: 5px; background-attachment: scroll; align-items: flex-start; padding-top: 20px;}
    .login-layout {flex-direction: column; gap: 15px;}
    
    /* Imagem em cima - compacta */
    .image-column {order: 1; width: 100%; display: flex; justify-content: center; align-items: center;}
    .login-column {order: 2; width: 100%; max-width: 350px;}
    .login-card {width: 100%; padding: 18px; border-radius: 14px; min-height: auto; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);}
    .image-container {width: 100%; max-width: 350px; height: 140px; display: flex; align-items: center; justify-content: center;}
    .side-image {max-width: 85%; max-height: 100px; width: auto; height: auto; filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.2));}
    .card-title {font-size: 1.3rem; text-align: center;}
    .welcome-section {flex-direction: column; text-align: center; gap: 8px; padding: 8px 0;}
    .header-icon {width: 40px; height: 40px; margin: 0 auto;}
    .login-icon {font-size: 1.1rem;}
    .form-group {margin-bottom: 16px;}
    .form-control {padding: 12px 14px; font-size: 16px; border-radius: 8px;}
    .btn-login {width: 100%; padding: 14px; font-size: 1rem; border-radius: 8px;}
}

/* Mobile Pequeno - Ajustes extras */
@media (max-width: 480px) {
    .login-container {padding: 3px; padding-top: 15px;}
    .login-layout {gap: 10px;}
    .login-card {padding: 14px; border-radius: 10px;}
    .image-container {height: 120px; max-width: 320px;}
    .side-image {max-height: 80px;}
    .card-title {font-size: 1.2rem;}
    .header-icon {width: 36px; height: 36px;}
    .form-control {padding: 10px 12px; font-size: 16px;}
    .btn-login {padding: 12px; font-size: 0.95rem;}
    .whatsapp-float {bottom: 20px !important; right: 20px !important;}
    .whatsapp-link {width: 50px; height: 50px;}
    .whatsapp-icon img {width: 20px; height: 20px;}
    .whatsapp-tooltip {display: none;}
}

/* Botão Flutuante WhatsApp */
.whatsapp-float {position: fixed; bottom: 30px; right: 30px; z-index: var(--z-index-whatsapp-float);}
.whatsapp-link {display: flex; align-items: center; justify-content: center; width: 60px; height: 60px; background: #25d366; border-radius: 50%; box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3); text-decoration: none; color: white; transition: all 0.3s ease; position: relative; overflow: hidden; border: none; outline: none;}
.whatsapp-link:hover {transform: scale(1.1); box-shadow: 0 6px 20px rgba(37, 211, 102, 0.5); color: white; text-decoration: none; background: #22c55e;}
.whatsapp-link:active {transform: scale(0.95);}
.whatsapp-link:focus {outline: none; box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.3);}
.whatsapp-icon {display: flex; align-items: center; justify-content: center; width: 100%; height: 100%;}
.whatsapp-icon img {width: 50px; height: 50px; object-fit: contain;}
.whatsapp-tooltip {position: absolute; right: 70px; top: 50%; transform: translateY(-50%); background: rgba(0, 0, 0, 0.8); color: white; padding: 8px 12px; border-radius: 6px; font-size: 14px; font-weight: 500; white-space: nowrap; opacity: 0; visibility: hidden; transition: all 0.3s ease; pointer-events: none;}
.whatsapp-tooltip::after {content: ''; position: absolute; right: -5px; top: 50%; transform: translateY(-50%); border-left: 5px solid rgba(0, 0, 0, 0.8); border-top: 5px solid transparent; border-bottom: 5px solid transparent;}
.whatsapp-float:hover .whatsapp-tooltip {opacity: 1; visibility: visible; right: 75px;}
