/**
 * Estilos para el Validador de CNPJ/CPF
 * Formulario de cotización
 */

/* Títulos de sección */
.section-title-cadastro,
.section-title-contato {
    margin-top: 20px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #4CAF50;
}

.section-title-cadastro h3,
.section-title-contato h3 {
    margin: 0;
    color: #333;
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.section-title-contato {
    margin-top: 30px;
}

.cnpj-validation-ui {
    margin-top: 15px;
    margin-bottom: 20px;
}

#validate_cnpj_btn {
    background: var(--theme-palette-color-2);
    color: white;
    border: none;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    max-width: 250px;
}

#validate_cnpj_btn:hover {
    background: var(--theme-palette-color-1);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

#validate_cnpj_btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

#cnpj_status {
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 15px;
}

#cnpj_status p {
    margin: 0;
    font-size: 14px;
    font-weight: 500;
}

/* Cliente encontrado */
#client_found_container {
    animation: slideDown 0.3s ease;
}

#client_found_container > div {
    background: #d4edda;
    border: 2px solid #28a745;
    border-radius: 8px;
    padding: 20px;
}

#client_found_container strong {
    color: #155724;
    font-size: 16px;
    display: block;
    margin-bottom: 12px;
}

#client_found_container p {
    margin: 8px 0;
    color: #155724;
    font-size: 14px;
}

/* Badges de email */
#client_email span {
    transition: all 0.2s ease;
}

#client_email span:hover {
    background: var(--theme-palette-color-1) !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.3);
}

/* ===========================
   EMAIL TAGS INPUT
   =========================== */

#email_tags_container {
    transition: border-color 0.3s ease;
}

#email_tags_container:focus-within {
    border-color: var(--theme-palette-color-2) !important;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.email-tag:hover {
    background: var(--theme-palette-color-1) !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.3);
}

.email-tag-remove:hover {
    opacity: 1 !important;
    transform: scale(1.2);
}

#email_input:focus {
    outline: none !important;
}

#email_input::placeholder {
    color: #999;
    font-size: 13px;
}

/* Cliente no encontrado */
#client_not_found_container {
    animation: slideDown 0.3s ease;
}

#client_not_found_container > div {
    background: #fff3cd;
    border: 2px solid #ffc107;
    border-radius: 8px;
    padding: 20px;
}

#client_not_found_container strong {
    color: #856404;
    font-size: 16px;
    display: block;
    margin-bottom: 8px;
}

#client_not_found_container p {
    color: #856404;
    font-size: 14px;
}

#register_new_client_btn {
    background: #ffc107;
    color: #856404;
    border: none;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 12px;
}

#register_new_client_btn:hover {
    background: #ffb300;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.3);
}

/* Formulario de registro */
#registration_form_container {
    background: white;
    border: 2px solid var(--theme-palette-color-2);
    border-radius: 10px;
    padding: 25px;
    margin-top: 20px;
    animation: slideDown 0.3s ease;
}

#registration_form_container h4 {
    margin: 0 0 20px 0;
    color: var(--theme-palette-color-2);
    font-size: 18px;
    font-weight: 700;
    border-bottom: 2px solid var(--theme-palette-color-2);
    padding-bottom: 10px;
}

#client_registration_form label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #333;
    font-size: 13px;
}

#client_registration_form input[type="text"],
#client_registration_form input[type="email"],
#client_registration_form select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

#client_registration_form input[type="text"]:focus,
#client_registration_form input[type="email"]:focus,
#client_registration_form select:focus {
    outline: none;
    border-color: var(--theme-palette-color-2);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

#client_registration_form button[type="submit"] {
    background: #28a745;
    color: white;
    border: none;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

#client_registration_form button[type="submit"]:hover {
    background: #218838;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

#client_registration_form button[type="submit"]:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

#cancel_registration_btn {
    background: #6c757d;
    color: white;
    border: none;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

#cancel_registration_btn:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

/* Animaciones */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* Responsive */
@media (max-width: 768px) {
    #client_registration_form > div[style*="grid"] {
        grid-template-columns: 1fr !important;
    }
    
    #validate_cnpj_btn {
        max-width: 100%;
    }
}

/* ===========================
   BOTÓN DE SUBMIT DESHABILITADO
   =========================== */

button[name="addify_checkout_place_quote"]:disabled {
    opacity: 0.5;
    cursor: not-allowed !important;
    background-color: #ccc !important;
    pointer-events: auto !important;
}

button[name="addify_checkout_place_quote"]:disabled:hover {
    transform: none !important;
}

/* ===========================
   MODAL DE BÚSQUEDA DE CIUDADES
   =========================== */

.city-modal {
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
}

.city-modal-content {
    background-color: #fff;
    border-radius: 10px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideDown 0.3s ease;
}

.city-modal-header {
    padding: 20px 25px;
    border-bottom: 2px solid var(--theme-palette-color-2);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.city-modal-header h3 {
    margin: 0;
    color: #fff;
    font-size: 20px;
    font-weight: 700;
}

.city-modal-close {
    color: #999;
    font-size: 32px;
    font-weight: 700;
    cursor: pointer;
    line-height: 1;
    transition: color 0.3s ease;
}

.city-modal-close:hover {
    color: #333;
}

.city-modal-body {
    padding: 25px;
    overflow-y: auto;
}

.city-results-list {
    max-height: 400px;
    overflow-y: auto;
}

.city-result-item {
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.city-result-item:hover {
    background-color: #f0f4ff;
    border-color: var(--theme-palette-color-2);
}

.city-result-item strong {
    color: #333;
    font-size: 15px;
}

.city-result-item small {
    margin-top: 5px;
}

/* Campo de ciudad con cursor pointer */
.cidade-search-trigger {
    cursor: pointer !important;
}

.cidade-search-trigger:hover {
    background-color: #f8f9fa !important;
}

@media (max-width: 768px) {
    .city-modal-content {
        width: 95%;
        max-height: 90vh;
    }
    
    .city-modal-header {
        padding: 15px 20px;
    }
    
    .city-modal-body {
        padding: 20px;
    }
}
